Skip to content

Commit

Permalink
Merge pull request #2344 from phanyzewski/patch_api_request_generator
Browse files Browse the repository at this point in the history
Patch api_request_spec template PATCH/update
  • Loading branch information
JonRowe committed May 25, 2020
1 parent 2209a4f commit 93bd42a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/generators/rspec/scaffold/templates/api_request_spec.rb
Expand Up @@ -94,17 +94,17 @@
it "updates the requested <%= ns_file_name %>" do
<%= file_name %> = <%= class_name %>.create! valid_attributes
patch <%= show_helper.tr('@', '') %>,
params: { <%= singular_table_name %>: invalid_attributes }, headers: valid_headers, as: :json
params: { <%= singular_table_name %>: new_attributes }, headers: valid_headers, as: :json
<%= file_name %>.reload
skip("Add assertions for updated state")
end
it "renders a JSON response with the <%= ns_file_name %>" do
<%= file_name %> = <%= class_name %>.create! valid_attributes
patch <%= show_helper.tr('@', '') %>,
params: { <%= singular_table_name %>: invalid_attributes }, headers: valid_headers, as: :json
params: { <%= singular_table_name %>: new_attributes }, headers: valid_headers, as: :json
expect(response).to have_http_status(:ok)
expect(response.content_type).to eq("application/json")
expect(response.content_type).to match(a_string_including("application/json"))
end
end
Expand Down

0 comments on commit 93bd42a

Please sign in to comment.