Skip to content

Commit

Permalink
raise retirement event called with user should expect the user info
Browse files Browse the repository at this point in the history
  • Loading branch information
d-m-u committed Feb 20, 2019
1 parent 1680ffb commit 888be6b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion spec/models/service/retirement_management_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,17 @@
it "with user" do
event_name = 'foo'
event_hash = {:userid => "admin", :service => @service, :type => "Service"}
expect(MiqEvent).to receive(:raise_evm_event).with(@service, event_name, event_hash, :user_id => user.id, :group_id => user.current_group.id, :tenant_id => user.current_tenant.id)
expect(MiqEvent).to receive(:raise_evm_event).with(@service, event_name, event_hash, {})
@service.raise_retirement_event(event_name, "admin")
end

it "with user" do
event_name = 'foo'
event_hash = {:userid => user, :service => @service, :type => "Service"}
expect(MiqEvent).to receive(:raise_evm_event).with(@service, event_name, event_hash, :user_id => user.id, :group_id => user.current_group.id, :tenant_id => user.current_tenant.id)
@service.raise_retirement_event(event_name, user)
end

it "with user that isn't found" do
event_name = 'foo'
event_hash = {:userid => "nonexistent_username", :service => @service, :type => "Service"}
Expand Down

0 comments on commit 888be6b

Please sign in to comment.