Skip to content

Commit

Permalink
Merge pull request #53 from bmclaughlin/miq_pr_13152
Browse files Browse the repository at this point in the history
Enable provision instances button via providers
  • Loading branch information
mzazrivec authored Jan 6, 2017
2 parents 18a777c + 4ef7e51 commit b30561c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/helpers/application_helper/toolbar_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ def hide_button_ops(id)
def hide_button?(id)
# need to hide add buttons when on sub-list view screen of a CI.
return true if id.ends_with?("_new", "_discover") &&
@lastaction == "show" && !["main", "vms"].include?(@display)
@lastaction == "show" && !%w(main vms instances).include?(@display)

# user can see the buttons if they can get to Policy RSOP/Automate Simulate screen
return false if ["miq_ae_tools"].include?(@layout)
Expand Down
18 changes: 11 additions & 7 deletions spec/helpers/application_helper/toolbar_builder_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -304,13 +304,17 @@
end
end

context "when with vm_miq_request_new" do
it "and @lastaction = show, @display = vms" do
@id = "vm_miq_request_new"
@lastaction = "show"
@display = "vms"
stub_user(:features => :all)
expect(subject).to be_falsey
context 'last action set to show' do
let(:lastaction) { 'show' }
context 'requested to display instances' do
let(:display) { 'instances' }
it 'returns with false' do
@lastaction = lastaction
@display = display
@id = 'vm_miq_request_new'
stub_user(:features => :all)
expect(subject).to be_falsey
end
end
end

Expand Down

0 comments on commit b30561c

Please sign in to comment.