From 0f5297001698a7a8f27e5bb4500358d1b826af01 Mon Sep 17 00:00:00 2001 From: Greg McCullough Date: Mon, 8 Apr 2019 17:00:22 -0400 Subject: [PATCH] Merge pull request #18638 from tinaafitz/retirement_approval_fix Retirement - remove auto_approve flag on request creation. (cherry picked from commit 0d66d43b274bad97ac5a42a1413b76fb23d20c58) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1702075 --- app/models/mixins/retirement_mixin.rb | 2 +- spec/models/service/retirement_management_spec.rb | 4 ++-- spec/models/vm/retirement_management_spec.rb | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/models/mixins/retirement_mixin.rb b/app/models/mixins/retirement_mixin.rb index b315e4d8ddd..ae9a3f7a69f 100644 --- a/app/models/mixins/retirement_mixin.rb +++ b/app/models/mixins/retirement_mixin.rb @@ -14,7 +14,7 @@ def make_retire_request(*src_ids, requester) klass = (name.demodulize + "RetireRequest").constantize options = {:src_ids => src_ids.presence, :__request_type__ => klass.request_types.first} set_retirement_requester(options[:src_ids], requester) - klass.make_request(nil, options, requester, true) + klass.make_request(nil, options, requester) end def retire(ids, options = {}) diff --git a/spec/models/service/retirement_management_spec.rb b/spec/models/service/retirement_management_spec.rb index 625e651a027..1270942f1d7 100644 --- a/spec/models/service/retirement_management_spec.rb +++ b/spec/models/service/retirement_management_spec.rb @@ -99,12 +99,12 @@ end it "with one src_id" do - expect(ServiceRetireRequest).to receive(:make_request).with(nil, {:src_ids => [service3.id], :__request_type__ => "service_retire"}, user, true) + expect(ServiceRetireRequest).to receive(:make_request).with(nil, {:src_ids => [service3.id], :__request_type__ => "service_retire"}, user) @service.class.to_s.demodulize.constantize.make_retire_request(service3.id, user) end it "with many src_ids" do - expect(ServiceRetireRequest).to receive(:make_request).with(nil, {:src_ids => [@service.id, service3.id, service_without_owner.id], :__request_type__ => "service_retire"}, user, true) + expect(ServiceRetireRequest).to receive(:make_request).with(nil, {:src_ids => [@service.id, service3.id, service_without_owner.id], :__request_type__ => "service_retire"}, user) @service.class.to_s.demodulize.constantize.make_retire_request(@service.id, service3.id, service_without_owner.id, user) end diff --git a/spec/models/vm/retirement_management_spec.rb b/spec/models/vm/retirement_management_spec.rb index db0b000b8bf..caa6defef00 100644 --- a/spec/models/vm/retirement_management_spec.rb +++ b/spec/models/vm/retirement_management_spec.rb @@ -82,12 +82,12 @@ describe "retire request" do it "with one src_id" do - expect(VmRetireRequest).to receive(:make_request).with(nil, {:src_ids => [@vm.id], :__request_type__ => "vm_retire"}, user, true) + expect(VmRetireRequest).to receive(:make_request).with(nil, {:src_ids => [@vm.id], :__request_type__ => "vm_retire"}, user) Vm.make_retire_request(@vm.id, user) end it "with many src_ids" do - expect(VmRetireRequest).to receive(:make_request).with(nil, {:src_ids => [@vm.id, vm2.id], :__request_type__ => "vm_retire"}, user, true) + expect(VmRetireRequest).to receive(:make_request).with(nil, {:src_ids => [@vm.id, vm2.id], :__request_type__ => "vm_retire"}, user) Vm.make_retire_request(@vm.id, vm2.id, user) end end