Skip to content

Commit ab1afba

Browse files
committed
Use _url instead of _path helpers in scaffold request template
To make it more consistent
1 parent 2738a0b commit ab1afba

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/generators/rspec/scaffold/templates/request_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,25 +64,25 @@
6464
context "with valid parameters" do
6565
it "creates a new <%= class_name %>" do
6666
expect {
67-
post <%= "#{index_helper}_path" %>, params: { <%= ns_file_name %>: valid_attributes }
67+
post <%= "#{index_helper}_url" %>, params: { <%= ns_file_name %>: valid_attributes }
6868
}.to change(<%= class_name %>, :count).by(1)
6969
end
7070
7171
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 }
7373
expect(response).to redirect_to(<%= singular_url_helper("#{class_name}.last") %>)
7474
end
7575
end
7676
7777
context "with invalid parameters" do
7878
it "does not create a new <%= class_name %>" do
7979
expect {
80-
post <%= "#{index_helper}_path" %>, params: { <%= ns_file_name %>: invalid_attributes }
80+
post <%= "#{index_helper}_url" %>, params: { <%= ns_file_name %>: invalid_attributes }
8181
}.to change(<%= class_name %>, :count).by(0)
8282
end
8383
8484
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 }
8686
expect(response).to be_successful
8787
end
8888
end

0 commit comments

Comments
 (0)