質問編集履歴

2

add comment

2016/10/25 14:14

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -124,6 +124,8 @@
124
124
 
125
125
  何故testになるとこの部分の挙動が違うのでしょうか。
126
126
 
127
+ (idが生成されていない -> DBにsaveされずにinstanceだけ生成されている -> newと同じ挙動??)
128
+
127
129
 
128
130
 
129
131
  ちなみにversionは

1

change code

2016/10/25 14:14

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -54,7 +54,11 @@
54
54
 
55
55
  ```ruby
56
56
 
57
+ Rails.application.routes.draw do
58
+
57
- resources 'articles'
59
+ resources 'articles'
60
+
61
+ end
58
62
 
59
63
  ```
60
64
 
@@ -84,11 +88,19 @@
84
88
 
85
89
  ```ruby
86
90
 
87
- it "creates new article in the database" do
91
+ require 'rails_helper'
88
92
 
89
- post :create
90
93
 
94
+
95
+ RSpec.describe ArticlesController, type: :controller do
96
+
97
+ it "creates new article in the database" do
98
+
99
+ post :create
100
+
91
- expect(renponse).to redirect_to edit_article_path(assigns[:article])
101
+ expect(renponse).to redirect_to edit_article_path(assigns[:article])
102
+
103
+ end
92
104
 
93
105
  end
94
106