Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed params PUT #update with valid params in controller spec #2591

Merged
merged 1 commit into from Apr 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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