From 4a6055964e09ef5c0ab2b795c88e294910b8b657 Mon Sep 17 00:00:00 2001 From: Chris Arcand Date: Tue, 26 Sep 2017 12:53:11 -0500 Subject: [PATCH] Remove any_instance_of wherever easily possible --- spec/models/automation_request_spec.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spec/models/automation_request_spec.rb b/spec/models/automation_request_spec.rb index 9da207a4652..b2f3c9c60f9 100644 --- a/spec/models/automation_request_spec.rb +++ b/spec/models/automation_request_spec.rb @@ -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 @@ -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