Skip to content

Commit

Permalink
Merge pull request #9249 from agrare/fix_vm_miq_request_provision_button
Browse files Browse the repository at this point in the history
Fix the VM Infra button checking EmsCloud providers
  • Loading branch information
Fryguy authored Aug 16, 2024
2 parents d906b9d + d20ebbc commit 9fbcf7b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ def disabled?

def provisioning_supported?
# TODO: EmsCloud.supporting(:provisioning).any?
EmsCloud.all.any? { |ems| ems.supports?(:provisioning) }
EmsInfra.all.any? { |ems| ems.supports?(:provisioning) }
end
end
22 changes: 22 additions & 0 deletions spec/helpers/application_helper/buttons/vm_miq_request_new_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
describe ApplicationHelper::Button::VmMiqRequestNew do
let(:view_context) { setup_view_context_with_sandbox({}) }
let(:button) { described_class.new(view_context, {}, {}, {}) }

describe '#disabled?' do
context "with no ext_management_systems" do
it_behaves_like "a disabled button", "No Infrastructure Provider that supports VM provisioning added"
end

context "with a cloud ext_management_system" do
let!(:ems) { FactoryBot.create(:ems_cloud) }

it_behaves_like "a disabled button", "No Infrastructure Provider that supports VM provisioning added"
end

context "with an infrastructure ext_management_system" do
let!(:ems) { FactoryBot.create(:ems_infra) }

it_behaves_like "an enabled button"
end
end
end

0 comments on commit 9fbcf7b

Please sign in to comment.