summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Chao <mchao@gitlab.com>2018-07-19 10:43:17 +0800
committerMark Chao <mchao@gitlab.com>2018-07-19 10:54:39 +0800
commitcddca8336b67d4433a0bfecd0f6cd9b014139724 (patch)
tree4c976b09a49157f6d233dea5af085400ddc589ec
parent1e85830bb53dedc35c841c592487b6aec7c9c556 (diff)
downloadgitlab-ce-ee-6470-milestone-dates-integrated-into-epics.tar.gz
Convert use of any_instance as it does not work with prependee-6470-milestone-dates-integrated-into-epics
-rw-r--r--spec/services/notes/create_service_spec.rb4
-rw-r--r--spec/support/shared_examples/services/boards/issues_move_service.rb4
2 files changed, 6 insertions, 2 deletions
diff --git a/spec/services/notes/create_service_spec.rb b/spec/services/notes/create_service_spec.rb
index 0fd37c95e42..b1290fd0d47 100644
--- a/spec/services/notes/create_service_spec.rb
+++ b/spec/services/notes/create_service_spec.rb
@@ -145,7 +145,9 @@ describe Notes::CreateService do
let(:note_text) { %(HELLO\n/close\n/assign @#{user.username}\nWORLD) }
it 'saves the note and does not alter the note text' do
- expect_any_instance_of(Issues::UpdateService).to receive(:execute).and_call_original
+ service = double(:service)
+ allow(Issues::UpdateService).to receive(:new).and_return(service)
+ expect(service).to receive(:execute)
note = described_class.new(project, user, opts.merge(note: note_text)).execute
diff --git a/spec/support/shared_examples/services/boards/issues_move_service.rb b/spec/support/shared_examples/services/boards/issues_move_service.rb
index 737863ea411..6d29a97c56d 100644
--- a/spec/support/shared_examples/services/boards/issues_move_service.rb
+++ b/spec/support/shared_examples/services/boards/issues_move_service.rb
@@ -4,7 +4,9 @@ shared_examples 'issues move service' do |group|
let(:params) { { board_id: board1.id, from_list_id: list1.id, to_list_id: list2.id } }
it 'delegates the label changes to Issues::UpdateService' do
- expect_any_instance_of(Issues::UpdateService).to receive(:execute).with(issue).once
+ service = double(:service)
+ expect(Issues::UpdateService).to receive(:new).and_return(service)
+ expect(service).to receive(:execute).with(issue).once
described_class.new(parent, user, params).execute(issue)
end