Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retirement - remove auto_approve flag on request creation. #18638

Merged
merged 1 commit into from
Apr 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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