Skip to content

Commit

Permalink
Remove any_instance_of wherever easily possible
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisarcand committed Sep 26, 2017
1 parent cd3db79 commit 4a60559
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions spec/models/automation_request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,12 @@
end

it "calls #call_automate_event_queue('request_approved')" do
expect_any_instance_of(AutomationRequest).to receive(:call_automate_event_queue).with('request_approved').once
expect(@ar).to receive(:call_automate_event_queue).with('request_approved').once
@ar.approve(@approver, @reason)
end

it "calls #execute" do
expect_any_instance_of(AutomationRequest).to receive(:execute).once
expect(@ar).to receive(:execute).once
@ar.approve(@approver, @reason)
end
end
Expand All @@ -212,9 +212,9 @@
before(:each) do
@ar = AutomationRequest.create_from_ws(@version, admin, @uri_parts, @parameters, {})
root = {'ae_result' => 'ok'}
ws = double('ws')
allow(ws).to receive_messages(:root => root)
allow_any_instance_of(AutomationRequest).to receive(:call_automate_event).and_return(ws)
@ws = double('ws')
allow(@ws).to receive_messages(:root => root)
allow(@ar).to receive(:call_automate_event).and_return(@ws)

@ar.create_request_tasks
@ar.reload
Expand Down

0 comments on commit 4a60559

Please sign in to comment.