Skip to content

Commit

Permalink
Merge pull request #18638 from tinaafitz/retirement_approval_fix
Browse files Browse the repository at this point in the history
Retirement - remove auto_approve flag on request creation.
  • Loading branch information
gmcculloug authored Apr 8, 2019
2 parents 7ef7460 + b035ee4 commit 0d66d43
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/models/mixins/retirement_mixin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {})
Expand Down
4 changes: 2 additions & 2 deletions spec/models/service/retirement_management_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@
end

it "with one src_id" do
expect(ServiceRetireRequest).to receive(:make_request).with(nil, {:src_ids => [@service.id], :__request_type__ => "service_retire"}, user, true)
expect(ServiceRetireRequest).to receive(:make_request).with(nil, {:src_ids => [@service.id], :__request_type__ => "service_retire"}, user)
@service.class.to_s.demodulize.constantize.make_retire_request(@service.id, user)
end

it "with src_ids" do
expect(ServiceRetireRequest).to receive(:make_request).with(nil, {:src_ids => [@service.id, service_with_owner.id], :__request_type__ => "service_retire"}, user, true)
expect(ServiceRetireRequest).to receive(:make_request).with(nil, {:src_ids => [@service.id, service_with_owner.id], :__request_type__ => "service_retire"}, user)
@service.class.to_s.demodulize.constantize.make_retire_request(@service.id, service_with_owner.id, user)
end

Expand Down
4 changes: 2 additions & 2 deletions spec/models/vm/retirement_management_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,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
Expand Down

0 comments on commit 0d66d43

Please sign in to comment.