-
Notifications
You must be signed in to change notification settings - Fork 356
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 Manage policies and Check compliance buttons for Container Images and others #4206
Fix Manage policies and Check compliance buttons for Container Images and others #4206
Conversation
@miq-bot add_label bug, gaprindashvili/yes |
99b1e89
to
eb527c8
Compare
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1530259 Add missing assign_policies method calling to button method to make managing policies work for Container Images, Replicators etc.
007ab31
to
d257fb5
Compare
d257fb5
to
7879ab1
Compare
@martinpovolny @mzazrivec Could you, please, review? Thanks! |
@skateman Could you, please, review my specs? Thank you! ;) |
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.
Specs are beautiful, just small changes 😉
@@ -202,8 +202,8 @@ def test_setting_few_fields | |||
end | |||
end | |||
|
|||
context "#button" do | |||
before(:each) do | |||
describe "#button" do |
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.
😍 😍 😍
context "updates provider with new token" do | ||
before :each do | ||
before do |
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.
😍 😍 😍
@@ -126,9 +126,9 @@ def test_creating(emstype) | |||
end | |||
end | |||
|
|||
context "#update" do | |||
describe "#update" do |
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.
😍 😍 😍
context "#button" do | ||
before(:each) do | ||
describe "#button" do | ||
before do |
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.
😍 😍 😍
'container_replicator' => 'Container Replicators', | ||
'container_node' => 'Container Nodes', | ||
'container_group' => 'Container Pods' | ||
}.each do |display_s, items| |
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.
You might not need the hash values, just use an array and then call humanize.pluralize
on each item.
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.
But.. what about Container Pods?
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.
Do you really need it in the testing, or just in the describe/context/it strings?
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.
If I removed the hash values and replaced them by an array of four items, I don't know how to set the string for context block properly and nicely (to see there for example 'tagging selected Container Pods' and not 'tagging selected Container Groups'). It's only for this there - for info what is being tested (context).
I consider this solution as the easiest and the most readable (at least for now). If something went wrong in some of the specs, we can easily recognize, what went wrong: we will not need to figure out that container_group
is related to Container Pods because it's already there. And I need all of the contexts there to set params[:pressed]
properly for each situation.
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.
ok
let(:provider) { ManageIQ::Providers::ContainerManager.new } | ||
|
||
before do | ||
allow(controller).to receive(:javascript_redirect).and_return(true) |
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.
Do you really need the and_return
here?
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.
I will check it once again, thank you very much, David!
b00c996
to
7339c81
Compare
Add tests for the buttons for nested lists of Container Images/Nodes/Pods/Replicators.
7339c81
to
e81fdf3
Compare
Checked commits hstastna/manageiq-ui-classic@2c9ccc8~...e81fdf3 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
@skateman @martinpovolny Any update about this? Could this be merged or any other things which I should add/change? Thank you! ;) |
@hstastna I'll take a look after lunch |
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.
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1530259
What:
Fix Manage policies button for Container Images which was "not yet implemented" even if this functionality is implemented and working if not accessing Container Images through Contaier provider's summary page but directly (Compute > Containers > Container Images).
Fix the same problem also for Container Replicators, Container Pods, Container Nodes.
Fix the same "Button not yet implemented" problem for Container Replicators, Pods, Nodes and Images also for Check Compliance of Last Known Configuration button.
Steps to reproduce:
=> nothing happens, just "Button not yet implemented" flash message is displayed!
Details:
Calling
assign_policies
method for managing policies was simply missing in EmsCommon module, inbutton
method. This did not work for some other nested lists displayed through Containers provider's summary page. If we go directly to Compute > Containers > Container Images/Nodes/Pods/Replicators, all the buttons work well.Before:
Managing policies of selected Container Image:
Checking Compliance of Last Known Configuration of selected Container Image:
(the same picture as above)
After:
Managing policies of selected Container Image:
Checking Compliance of Last Known Configuration of selected Container Image: