-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Patch api_request_spec template PATCH/update #2344
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you close one or the other PRs? We don't need duplicate PRs as it is easier for us to cherry-pick the merge commit across to the other, my preference is to merge PRs to master
and cherry-pick across to 4-0-maintenance
but I don't mind which you keep.
Can you fix the spec so the build passes and then I'm happy with this.
<%= 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") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expect(response.content_type).to eq("application/json") | |
expect(response.content_type).to match(a_string_including("application/json")) |
5326567
to
6b75bc8
Compare
…pdate with valid parameters.
6b75bc8
to
240e860
Compare
Thanks! |
Patch api_request_spec template PATCH/update
Generating api request specs using
rails g scaffold
creates invalid default test cases for PATCH/update.new_attributes should be used in place of invalid_attributes in the template