diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2017-06-21 16:48:12 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-06-21 16:48:12 +0300 |
commit | 0430b7644101fc70ed4be6bf69ccf05b900f4cdf (patch) | |
tree | 3ea258c4da6e0f9c6e0f7523191fdb0a64a15c73 /spec/services/merge_requests | |
parent | 78ee24ba53a4a44d829613495ec0d5f1bbb5a9ee (diff) |
Enable Style/DotPosition Rubocop :cop:
Diffstat (limited to 'spec/services/merge_requests')
7 files changed, 36 insertions, 37 deletions
diff --git a/spec/services/merge_requests/close_service_spec.rb b/spec/services/merge_requests/close_service_spec.rb index 154f30aac3b..074d4672b06 100644 --- a/spec/services/merge_requests/close_service_spec.rb +++ b/spec/services/merge_requests/close_service_spec.rb @@ -32,8 +32,8 @@ describe MergeRequests::CloseService, services: true do it { expect(@merge_request).to be_closed } it 'executes hooks with close action' do - expect(service).to have_received(:execute_hooks). - with(@merge_request, 'close') + expect(service).to have_received(:execute_hooks) + .with(@merge_request, 'close') end it 'sends email to user2 about assign of new merge_request' do diff --git a/spec/services/merge_requests/conflicts/resolve_service_spec.rb b/spec/services/merge_requests/conflicts/resolve_service_spec.rb index c77e6e9cd50..6f49a65d795 100644 --- a/spec/services/merge_requests/conflicts/resolve_service_spec.rb +++ b/spec/services/merge_requests/conflicts/resolve_service_spec.rb @@ -64,9 +64,9 @@ describe MergeRequests::Conflicts::ResolveService do end it 'creates a commit with the correct parents' do - expect(merge_request.source_branch_head.parents.map(&:id)). - to eq(%w(1450cd639e0bc6721eb02800169e464f212cde06 - 824be604a34828eb682305f0d963056cfac87b2d)) + expect(merge_request.source_branch_head.parents.map(&:id)) + .to eq(%w(1450cd639e0bc6721eb02800169e464f212cde06 + 824be604a34828eb682305f0d963056cfac87b2d)) end end @@ -129,9 +129,8 @@ describe MergeRequests::Conflicts::ResolveService do it 'creates a commit with the correct parents' do resolve_conflicts - expect(merge_request_from_fork.source_branch_head.parents.map(&:id)). - to eq(['404fa3fc7c2c9b5dacff102f353bdf55b1be2813', - target_head]) + expect(merge_request_from_fork.source_branch_head.parents.map(&:id)) + .to eq(['404fa3fc7c2c9b5dacff102f353bdf55b1be2813', target_head]) end end end @@ -169,9 +168,9 @@ describe MergeRequests::Conflicts::ResolveService do end it 'creates a commit with the correct parents' do - expect(merge_request.source_branch_head.parents.map(&:id)). - to eq(%w(1450cd639e0bc6721eb02800169e464f212cde06 - 824be604a34828eb682305f0d963056cfac87b2d)) + expect(merge_request.source_branch_head.parents.map(&:id)) + .to eq(%w(1450cd639e0bc6721eb02800169e464f212cde06 + 824be604a34828eb682305f0d963056cfac87b2d)) end it 'sets the content to the content given' do @@ -204,8 +203,8 @@ describe MergeRequests::Conflicts::ResolveService do end it 'raises a MissingResolution error' do - expect { service.execute(user, invalid_params) }. - to raise_error(Gitlab::Conflict::File::MissingResolution) + expect { service.execute(user, invalid_params) } + .to raise_error(Gitlab::Conflict::File::MissingResolution) end end @@ -230,8 +229,8 @@ describe MergeRequests::Conflicts::ResolveService do end it 'raises a MissingResolution error' do - expect { service.execute(user, invalid_params) }. - to raise_error(Gitlab::Conflict::File::MissingResolution) + expect { service.execute(user, invalid_params) } + .to raise_error(Gitlab::Conflict::File::MissingResolution) end end @@ -250,8 +249,8 @@ describe MergeRequests::Conflicts::ResolveService do end it 'raises a MissingFiles error' do - expect { service.execute(user, invalid_params) }. - to raise_error(described_class::MissingFiles) + expect { service.execute(user, invalid_params) } + .to raise_error(described_class::MissingFiles) end end end diff --git a/spec/services/merge_requests/create_service_spec.rb b/spec/services/merge_requests/create_service_spec.rb index 2026b7f6510..36a2b672473 100644 --- a/spec/services/merge_requests/create_service_spec.rb +++ b/spec/services/merge_requests/create_service_spec.rb @@ -83,9 +83,9 @@ describe MergeRequests::CreateService, services: true do let!(:pipeline_3) { create(:ci_pipeline, project: project, ref: "other_branch", project_id: project.id) } before do - project.merge_requests. - where(source_branch: opts[:source_branch], target_branch: opts[:target_branch]). - destroy_all + project.merge_requests + .where(source_branch: opts[:source_branch], target_branch: opts[:target_branch]) + .destroy_all end it 'sets head pipeline' do diff --git a/spec/services/merge_requests/merge_service_spec.rb b/spec/services/merge_requests/merge_service_spec.rb index b3b188a805f..711059208c1 100644 --- a/spec/services/merge_requests/merge_service_spec.rb +++ b/spec/services/merge_requests/merge_service_spec.rb @@ -141,9 +141,9 @@ describe MergeRequests::MergeService, services: true do end it 'removes the source branch' do - expect(DeleteBranchService).to receive(:new). - with(merge_request.source_project, merge_request.author). - and_call_original + expect(DeleteBranchService).to receive(:new) + .with(merge_request.source_project, merge_request.author) + .and_call_original service.execute(merge_request) end end diff --git a/spec/services/merge_requests/refresh_service_spec.rb b/spec/services/merge_requests/refresh_service_spec.rb index 1f109eab268..671a932441e 100644 --- a/spec/services/merge_requests/refresh_service_spec.rb +++ b/spec/services/merge_requests/refresh_service_spec.rb @@ -57,8 +57,8 @@ describe MergeRequests::RefreshService, services: true do end it 'executes hooks with update action' do - expect(refresh_service).to have_received(:execute_hooks). - with(@merge_request, 'update', @oldrev) + expect(refresh_service).to have_received(:execute_hooks) + .with(@merge_request, 'update', @oldrev) expect(@merge_request.notes).not_to be_empty expect(@merge_request).to be_open @@ -83,8 +83,8 @@ describe MergeRequests::RefreshService, services: true do end it 'executes hooks with update action' do - expect(refresh_service).to have_received(:execute_hooks). - with(@merge_request, 'update', @oldrev) + expect(refresh_service).to have_received(:execute_hooks) + .with(@merge_request, 'update', @oldrev) expect(@merge_request.notes).not_to be_empty expect(@merge_request).to be_open @@ -146,8 +146,8 @@ describe MergeRequests::RefreshService, services: true do end it 'executes hooks with update action' do - expect(refresh_service).to have_received(:execute_hooks). - with(@fork_merge_request, 'update', @oldrev) + expect(refresh_service).to have_received(:execute_hooks) + .with(@fork_merge_request, 'update', @oldrev) expect(@merge_request.notes).to be_empty expect(@merge_request).to be_open @@ -228,8 +228,8 @@ describe MergeRequests::RefreshService, services: true do let(:refresh_service) { service.new(@fork_project, @user) } it 'refreshes the merge request' do - expect(refresh_service).to receive(:execute_hooks). - with(@fork_merge_request, 'update', Gitlab::Git::BLANK_SHA) + expect(refresh_service).to receive(:execute_hooks) + .with(@fork_merge_request, 'update', Gitlab::Git::BLANK_SHA) allow_any_instance_of(Repository).to receive(:merge_base).and_return(@oldrev) refresh_service.execute(Gitlab::Git::BLANK_SHA, @newrev, 'refs/heads/master') diff --git a/spec/services/merge_requests/reopen_service_spec.rb b/spec/services/merge_requests/reopen_service_spec.rb index b6d4db2f922..6cc403bdb7f 100644 --- a/spec/services/merge_requests/reopen_service_spec.rb +++ b/spec/services/merge_requests/reopen_service_spec.rb @@ -31,8 +31,8 @@ describe MergeRequests::ReopenService, services: true do it { expect(merge_request).to be_reopened } it 'executes hooks with reopen action' do - expect(service).to have_received(:execute_hooks). - with(merge_request, 'reopen') + expect(service).to have_received(:execute_hooks) + .with(merge_request, 'reopen') end it 'sends email to user2 about reopen of merge_request' do diff --git a/spec/services/merge_requests/update_service_spec.rb b/spec/services/merge_requests/update_service_spec.rb index fd46020bbdb..ec15b5cac14 100644 --- a/spec/services/merge_requests/update_service_spec.rb +++ b/spec/services/merge_requests/update_service_spec.rb @@ -78,8 +78,8 @@ describe MergeRequests::UpdateService, services: true do end it 'executes hooks with update action' do - expect(service).to have_received(:execute_hooks). - with(@merge_request, 'update') + expect(service).to have_received(:execute_hooks) + .with(@merge_request, 'update') end it 'sends email to user2 about assign of new merge request and email to user3 about merge request unassignment' do @@ -195,8 +195,8 @@ describe MergeRequests::UpdateService, services: true do head_pipeline_of: merge_request ) - expect(MergeRequests::MergeWhenPipelineSucceedsService).to receive(:new).with(project, user). - and_return(service_mock) + expect(MergeRequests::MergeWhenPipelineSucceedsService).to receive(:new).with(project, user) + .and_return(service_mock) expect(service_mock).to receive(:execute).with(merge_request) end |