File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
lib/generators/rspec/scaffold/templates Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 64
64
context "with valid parameters" do
65
65
it "creates a new <%= class_name %>" do
66
66
expect {
67
- post <%= "#{ index_helper } _path " %>, params: { <%= ns_file_name %>: valid_attributes }
67
+ post <%= "#{ index_helper } _url " %>, params: { <%= ns_file_name %>: valid_attributes }
68
68
}.to change(<%= class_name %>, :count).by(1)
69
69
end
70
70
71
71
it "redirects to the created <%= ns_file_name %>" do
72
- post <%= "#{ index_helper } _path " %>, params: { <%= ns_file_name %>: valid_attributes }
72
+ post <%= "#{ index_helper } _url " %>, params: { <%= ns_file_name %>: valid_attributes }
73
73
expect(response).to redirect_to(<%= singular_url_helper("#{ class_name } .last") %>)
74
74
end
75
75
end
76
76
77
77
context "with invalid parameters" do
78
78
it "does not create a new <%= class_name %>" do
79
79
expect {
80
- post <%= "#{ index_helper } _path " %>, params: { <%= ns_file_name %>: invalid_attributes }
80
+ post <%= "#{ index_helper } _url " %>, params: { <%= ns_file_name %>: invalid_attributes }
81
81
}.to change(<%= class_name %>, :count).by(0)
82
82
end
83
83
84
84
it "renders a successful response (i.e. to display the 'new' template)" do
85
- post <%= "#{ index_helper } _path " %>, params: { <%= ns_file_name %>: invalid_attributes }
85
+ post <%= "#{ index_helper } _url " %>, params: { <%= ns_file_name %>: invalid_attributes }
86
86
expect(response).to be_successful
87
87
end
88
88
end
You can’t perform that action at this time.
0 commit comments