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
(cherry picked from commit b30561c)

https://bugzilla.redhat.com/show_bug.cgi?id=1386342
  • Loading branch information
mzazrivec authored and simaishi committed Jan 12, 2017
1 parent ed29b50 commit d9fe1d8
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
Expand Up @@ -537,7 +537,7 @@ def build_toolbar_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)

if id == "summary_reload" # Show reload button if
return @explorer && # we are in explorer and
Expand Down
18 changes: 11 additions & 7 deletions spec/helpers/application_helper/toolbar_builder_spec.rb
Expand Up @@ -592,13 +592,17 @@ def method_missing(sym, *args)
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 d9fe1d8

Please sign in to comment.