diff options
Diffstat (limited to 'spec/services')
-rw-r--r-- | spec/services/issues/build_service_spec.rb | 14 | ||||
-rw-r--r-- | spec/services/issues/create_service_spec.rb | 8 | ||||
-rw-r--r-- | spec/services/issues/resolve_discussions_spec.rb | 14 |
3 files changed, 18 insertions, 18 deletions
diff --git a/spec/services/issues/build_service_spec.rb b/spec/services/issues/build_service_spec.rb index 79b093e51fb..1dd53236fbd 100644 --- a/spec/services/issues/build_service_spec.rb +++ b/spec/services/issues/build_service_spec.rb @@ -12,7 +12,7 @@ describe Issues::BuildService, services: true do describe '#execute' do let(:merge_request) { create(:merge_request, title: "Hello world", source_project: project) } let(:discussion) { Discussion.new([create(:diff_note_on_merge_request, project: project, noteable: merge_request, note: "Almost done")]) } - let(:service) { described_class.new(project, user, merge_request_for_resolving_discussions: merge_request.iid, discussion_to_resolve: discussion.id) } + let(:service) { described_class.new(project, user, merge_request_to_resolve_discussions_of: merge_request.iid, discussion_to_resolve: discussion.id) } it 'references the noteable title in the issue title' do issue = service.execute @@ -30,12 +30,12 @@ describe Issues::BuildService, services: true do context 'for discussions in a merge request' do let(:merge_request) { create(:merge_request_with_diff_notes, source_project: project) } - let(:issue) { described_class.new(project, user, merge_request_for_resolving_discussions: merge_request.iid).execute } + let(:issue) { described_class.new(project, user, merge_request_to_resolve_discussions_of: merge_request.iid).execute } describe '#items_for_discussions' do it 'has an item for each discussion' do create(:diff_note_on_merge_request, noteable: merge_request, project: merge_request.source_project, line_number: 13) - service = described_class.new(project, user, merge_request_for_resolving_discussions: merge_request.iid) + service = described_class.new(project, user, merge_request_to_resolve_discussions_of: merge_request.iid) service.execute @@ -44,7 +44,7 @@ describe Issues::BuildService, services: true do end describe '#item_for_discussion' do - let(:service) { described_class.new(project, user, merge_request_for_resolving_discussions: merge_request.iid) } + let(:service) { described_class.new(project, user, merge_request_to_resolve_discussions_of: merge_request.iid) } it 'mentions the author of the note' do discussion = Discussion.new([create(:diff_note_on_merge_request, author: create(:user, username: 'author'))]) @@ -76,7 +76,7 @@ describe Issues::BuildService, services: true do it 'does not assign title when a title was given' do issue = described_class.new(project, user, - merge_request_for_resolving_discussions: merge_request, + merge_request_to_resolve_discussions_of: merge_request, title: 'What an issue').execute expect(issue.title).to eq('What an issue') @@ -84,7 +84,7 @@ describe Issues::BuildService, services: true do it 'does not assign description when a description was given' do issue = described_class.new(project, user, - merge_request_for_resolving_discussions: merge_request, + merge_request_to_resolve_discussions_of: merge_request, description: 'Fix at your earliest conveignance').execute expect(issue.description).to eq('Fix at your earliest conveignance') @@ -122,7 +122,7 @@ describe Issues::BuildService, services: true do describe '#execute' do it 'mentions the merge request in the description' do - issue = described_class.new(project, user, merge_request_for_resolving_discussions: merge_request.iid).execute + issue = described_class.new(project, user, merge_request_to_resolve_discussions_of: merge_request.iid).execute expect(issue.description).to include("Review the conversation in #{merge_request.to_reference}") end diff --git a/spec/services/issues/create_service_spec.rb b/spec/services/issues/create_service_spec.rb index 77a984df2d5..776cbc4296b 100644 --- a/spec/services/issues/create_service_spec.rb +++ b/spec/services/issues/create_service_spec.rb @@ -150,7 +150,7 @@ describe Issues::CreateService, services: true do end describe 'for a single discussion' do - let(:opts) { { discussion_to_resolve: discussion.id, merge_request_for_resolving_discussions: merge_request.iid } } + let(:opts) { { discussion_to_resolve: discussion.id, merge_request_to_resolve_discussions_of: merge_request.iid } } it 'resolves the discussion' do described_class.new(project, user, opts).execute @@ -176,7 +176,7 @@ describe Issues::CreateService, services: true do it 'can set nil explicitly to the title and description' do issue = described_class.new(project, user, - merge_request_for_resolving_discussions: merge_request, + merge_request_to_resolve_discussions_of: merge_request, description: nil, title: nil).execute @@ -186,7 +186,7 @@ describe Issues::CreateService, services: true do end describe 'for a merge request' do - let(:opts) { { merge_request_for_resolving_discussions: merge_request.iid } } + let(:opts) { { merge_request_to_resolve_discussions_of: merge_request.iid } } it 'resolves the discussion' do described_class.new(project, user, opts).execute @@ -212,7 +212,7 @@ describe Issues::CreateService, services: true do it 'can set nil explicitly to the title and description' do issue = described_class.new(project, user, - merge_request_for_resolving_discussions: merge_request, + merge_request_to_resolve_discussions_of: merge_request, description: nil, title: nil).execute diff --git a/spec/services/issues/resolve_discussions_spec.rb b/spec/services/issues/resolve_discussions_spec.rb index a7175398aa1..6cc738aec08 100644 --- a/spec/services/issues/resolve_discussions_spec.rb +++ b/spec/services/issues/resolve_discussions_spec.rb @@ -23,10 +23,10 @@ describe DummyService, services: true do let(:other_merge_request) { create(:merge_request, source_project: project, source_branch: "other") } describe "#merge_request_for_resolving_discussion" do - let(:service) { described_class.new(project, user, merge_request_for_resolving_discussions: merge_request.iid) } + let(:service) { described_class.new(project, user, merge_request_to_resolve_discussions_of: merge_request.iid) } it "finds the merge request" do - expect(service.merge_request_for_resolving_discussions).to eq(merge_request) + expect(service.merge_request_to_resolve_discussions_of).to eq(merge_request) end it "only queries for the merge request once" do @@ -37,7 +37,7 @@ describe DummyService, services: true do expect(fake_results).to receive(:find_by).exactly(1) expect(MergeRequestsFinder).to receive(:new).and_return(fake_finder).exactly(1) - 2.times { service.merge_request_for_resolving_discussions } + 2.times { service.merge_request_to_resolve_discussions_of } end end @@ -47,7 +47,7 @@ describe DummyService, services: true do project, user, discussion_to_resolve: discussion.id, - merge_request_for_resolving_discussions: merge_request.iid + merge_request_to_resolve_discussions_of: merge_request.iid ) # We need to compare discussion id's because the Discussion-objects are rebuilt # which causes the object-id's not to be different. @@ -64,7 +64,7 @@ describe DummyService, services: true do service = described_class.new( project, user, - merge_request_for_resolving_discussions: merge_request.iid + merge_request_to_resolve_discussions_of: merge_request.iid ) # We need to compare discussion id's because the Discussion-objects are rebuilt # which causes the object-id's not to be different. @@ -82,7 +82,7 @@ describe DummyService, services: true do service = described_class.new( project, user, - merge_request_for_resolving_discussions: merge_request.iid + merge_request_to_resolve_discussions_of: merge_request.iid ) # We need to compare discussion id's because the Discussion-objects are rebuilt # which causes the object-id's not to be different. @@ -96,7 +96,7 @@ describe DummyService, services: true do project, user, discussion_to_resolve: discussion.id, - merge_request_for_resolving_discussions: other_merge_request.iid + merge_request_to_resolve_discussions_of: other_merge_request.iid ) expect(service.discussions_to_resolve).to be_empty |