From 7cc19cd5abb4ae8649e960c71d531adccb880a89 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Fri, 1 Sep 2017 18:13:00 -0400 Subject: Fix a spec failure dependent on load order We were incorrectly stubbing `Issues::MoveService#execute`. This only caused a failure when another spec caused it to be autoloaded -- `spec/controllers/projects/issues_controller_spec.rb` in this case. --- spec/services/issues/update_service_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/services/issues/update_service_spec.rb b/spec/services/issues/update_service_spec.rb index 2176469aba6..85f46838351 100644 --- a/spec/services/issues/update_service_spec.rb +++ b/spec/services/issues/update_service_spec.rb @@ -519,7 +519,7 @@ describe Issues::UpdateService, :mailer do end it 'calls the move service with the proper issue and project' do - move_stub = class_double("Issues::MoveService").as_stubbed_const + move_stub = instance_double(Issues::MoveService) allow(Issues::MoveService).to receive(:new).and_return(move_stub) allow(move_stub).to receive(:execute).with(issue, target_project).and_return(issue) -- cgit v1.2.1