Skip to content

Commit 9fbcf7b

Browse files
authored
Merge pull request #9249 from agrare/fix_vm_miq_request_provision_button
Fix the VM Infra button checking EmsCloud providers
2 parents d906b9d + d20ebbc commit 9fbcf7b

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

app/helpers/application_helper/button/vm_miq_request_new.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ def disabled?
88

99
def provisioning_supported?
1010
# TODO: EmsCloud.supporting(:provisioning).any?
11-
EmsCloud.all.any? { |ems| ems.supports?(:provisioning) }
11+
EmsInfra.all.any? { |ems| ems.supports?(:provisioning) }
1212
end
1313
end
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
describe ApplicationHelper::Button::VmMiqRequestNew do
2+
let(:view_context) { setup_view_context_with_sandbox({}) }
3+
let(:button) { described_class.new(view_context, {}, {}, {}) }
4+
5+
describe '#disabled?' do
6+
context "with no ext_management_systems" do
7+
it_behaves_like "a disabled button", "No Infrastructure Provider that supports VM provisioning added"
8+
end
9+
10+
context "with a cloud ext_management_system" do
11+
let!(:ems) { FactoryBot.create(:ems_cloud) }
12+
13+
it_behaves_like "a disabled button", "No Infrastructure Provider that supports VM provisioning added"
14+
end
15+
16+
context "with an infrastructure ext_management_system" do
17+
let!(:ems) { FactoryBot.create(:ems_infra) }
18+
19+
it_behaves_like "an enabled button"
20+
end
21+
end
22+
end

0 commit comments

Comments
 (0)