Skip to content

Commit

Permalink
Merge pull request #2591 from taketo1113/controller-spec-update
Browse files Browse the repository at this point in the history
Fixed params PUT #update with valid params in controller spec
  • Loading branch information
JonRowe committed Apr 20, 2022
1 parent a16a9b1 commit bd25be9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Expand Up @@ -100,7 +100,7 @@
it "renders a JSON response with the <%= singular_table_name %>" do
<%= file_name %> = <%= class_name %>.create! valid_attributes
put :update, params: {id: <%= file_name %>.to_param, <%= singular_table_name %>: valid_attributes}, session: valid_session
put :update, params: {id: <%= file_name %>.to_param, <%= singular_table_name %>: new_attributes}, session: valid_session
expect(response).to have_http_status(:ok)
expect(response.content_type).to eq('application/json')
end
Expand Down
2 changes: 1 addition & 1 deletion lib/generators/rspec/scaffold/templates/controller_spec.rb
Expand Up @@ -119,7 +119,7 @@
it "redirects to the <%= singular_table_name %>" do
<%= file_name %> = <%= class_name %>.create! valid_attributes
put :update, params: {id: <%= file_name %>.to_param, <%= singular_table_name %>: valid_attributes}, session: valid_session
put :update, params: {id: <%= file_name %>.to_param, <%= singular_table_name %>: new_attributes}, session: valid_session
expect(response).to redirect_to(<%= file_name %>)
end
end
Expand Down

0 comments on commit bd25be9

Please sign in to comment.