File tree 1 file changed +8
-0
lines changed
lib/generators/rspec/scaffold/templates
1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 118
118
end
119
119
120
120
context "with invalid parameters" do
121
+ <% if Rails.version.to_f < 6.1 || Rails.version == '6.1.0' %>
121
122
it "renders a successful response (i.e. to display the 'edit' template)" do
122
123
<%= file_name %> = <%= class_name %>.create! valid_attributes
123
124
patch <%= show_helper.tr('@', '') %>, params: { <%= singular_table_name %>: invalid_attributes }
124
125
expect(response).to be_successful
125
126
end
127
+ <% else %>
128
+ it "renders a response with 422 status - unporcessable entity" do
129
+ <%= file_name %> = <%= class_name %>.create! valid_attributes
130
+ patch <%= show_helper.tr('@', '') %>, params: { <%= singular_table_name %>: invalid_attributes }
131
+ expect(response.status).to eq(422)
132
+ end
133
+ <% end %>
126
134
end
127
135
end
128
136
You can’t perform that action at this time.
0 commit comments