-
Notifications
You must be signed in to change notification settings - Fork 141
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
Fix expand of custom_actions when they are nil #305
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.
Looks good, one tiny change.
spec/requests/custom_actions_spec.rb
Outdated
@@ -77,6 +77,15 @@ def expect_result_to_have_custom_actions_hash | |||
expect_result_to_have_keys(%w(id href actions)) | |||
expect(response.parsed_body["actions"].select { |a| a["method"] == "post" }.pluck("name")).to match_array(%w(edit add_resource remove_resource remove_all_resources add_provider_vms)) | |||
end | |||
|
|||
it "allows expanding of custom actions" do | |||
FactoryGirl.create(:service) |
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.
Move as a memoized helper after line 70 (let(:service)....
), this is test setup that can be reused in this block and kept out of the spec itself.
Checked commit jntullo@5054ff2 with ruby 2.3.3, rubocop 0.52.0, haml-lint 0.20.0, and yamllint 1.10.0 |
Fix expand of custom_actions when they are nil (cherry picked from commit cb4331a) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1539943
Gaprindashvili backport details:
|
When a resource has no
custom_actions
but is requested to have them expanded (ie/api/services?expand=resources&attributes=custom_actions
), it is failing because we attempt to add custom action hrefs to a nil value.Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1539741