Skip to content

Commit

Permalink
Remove ems method stub.
Browse files Browse the repository at this point in the history
  • Loading branch information
djberg96 committed Dec 11, 2019
1 parent c20f49d commit f694f1e
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions spec/models/vm_or_template/operations/snapshot_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,16 @@
let(:ems) { FactoryBot.create(:ems_vmware) }
let(:vm) { FactoryBot.create(:vm_vmware, :ext_management_system => ems) }
let(:snapshots) { FactoryBot.create_list(:snapshot, 2, :vm_or_template => vm) }
let(:queue_name) { 'snapshot_queue' }

context "queued methods" do
before do
allow(ems).to receive(:queue_name_for_ems_operations).and_return(queue_name)
end

it 'queues as expected in remove_snapshot_queue' do
queue = vm.remove_snapshot_queue(snapshots.first.id)

expect(queue).to have_attributes(
:class_name => vm.class.name,
:method_name => 'remove_snapshot',
:role => 'ems_operations',
:queue_name => queue_name,
:queue_name => vm.queue_name_for_ems_operations,
:zone => vm.my_zone,
:args => [snapshots.first.id],
:task_id => nil
Expand All @@ -34,7 +29,7 @@
:class_name => vm.class.name,
:method_name => 'remove_evm_snapshot',
:role => 'ems_operations',
:queue_name => queue_name,
:queue_name => vm.queue_name_for_ems_operations,
:zone => vm.my_zone,
:args => [snapshots.first.id],
:task_id => nil
Expand All @@ -54,7 +49,7 @@
:class_name => vm.class.name,
:method_name => 'remove_all_snapshots',
:role => 'ems_operations',
:queue_name => queue_name,
:queue_name => ems.queue_name_for_ems_operations,
:zone => ems.my_zone,
:args => []
)
Expand Down

0 comments on commit f694f1e

Please sign in to comment.