diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-02-23 01:50:15 +0300 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-02-23 18:33:05 +0300 |
commit | 1fe7501b49f896b74102c4b970310aa9ae34da85 (patch) | |
tree | ce271afb0fbaaa14291c1dc9009cd7815ee25463 /spec/services/merge_requests | |
parent | bdbc7d967a0c3d95d5e4ea19a2a5be41268d3540 (diff) |
Revert "Prefer leading style for Style/DotPosition"
This reverts commit cb10b725c8929b8b4460f89c9d96c773af39ba6b.
Diffstat (limited to 'spec/services/merge_requests')
8 files changed, 47 insertions, 47 deletions
diff --git a/spec/services/merge_requests/add_todo_when_build_fails_service_spec.rb b/spec/services/merge_requests/add_todo_when_build_fails_service_spec.rb index d80fb8a1af1..881458c190f 100644 --- a/spec/services/merge_requests/add_todo_when_build_fails_service_spec.rb +++ b/spec/services/merge_requests/add_todo_when_build_fails_service_spec.rb @@ -29,9 +29,9 @@ describe MergeRequests::AddTodoWhenBuildFailsService do end before do - allow_any_instance_of(MergeRequest) - .to receive(:head_pipeline) - .and_return(pipeline) + allow_any_instance_of(MergeRequest). + to receive(:head_pipeline). + and_return(pipeline) allow(service).to receive(:todo_service).and_return(todo_service) end @@ -113,9 +113,9 @@ describe MergeRequests::AddTodoWhenBuildFailsService do it 'resolves todos about failed builds for pipeline' do service.close_all(pipeline) - expect(todo_service) - .to have_received(:merge_request_build_retried) - .with(merge_request) + expect(todo_service). + to have_received(:merge_request_build_retried). + with(merge_request) end end @@ -125,8 +125,8 @@ describe MergeRequests::AddTodoWhenBuildFailsService do it 'does not resolve any todos about failed builds' do service.close_all(pipeline) - expect(todo_service) - .not_to have_received(:merge_request_build_retried) + expect(todo_service). + not_to have_received(:merge_request_build_retried) end end end diff --git a/spec/services/merge_requests/close_service_spec.rb b/spec/services/merge_requests/close_service_spec.rb index abc266b3aa7..d55a7657c0e 100644 --- a/spec/services/merge_requests/close_service_spec.rb +++ b/spec/services/merge_requests/close_service_spec.rb @@ -30,8 +30,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/merge_service_spec.rb b/spec/services/merge_requests/merge_service_spec.rb index 1dcb4f6b3ee..d96f819e66a 100644 --- a/spec/services/merge_requests/merge_service_spec.rb +++ b/spec/services/merge_requests/merge_service_spec.rb @@ -139,9 +139,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/merge_when_pipeline_succeeds_service_spec.rb b/spec/services/merge_requests/merge_when_pipeline_succeeds_service_spec.rb index f92978a33a3..65c08ce15f7 100644 --- a/spec/services/merge_requests/merge_when_pipeline_succeeds_service_spec.rb +++ b/spec/services/merge_requests/merge_when_pipeline_succeeds_service_spec.rb @@ -27,9 +27,9 @@ describe MergeRequests::MergeWhenPipelineSucceedsService do context 'first time enabling' do before do - allow(merge_request) - .to receive(:head_pipeline) - .and_return(pipeline) + allow(merge_request). + to receive(:head_pipeline). + and_return(pipeline) service.execute(merge_request) end @@ -52,11 +52,11 @@ describe MergeRequests::MergeWhenPipelineSucceedsService do let(:build) { create(:ci_build, ref: mr_merge_if_green_enabled.source_branch) } before do - allow(mr_merge_if_green_enabled).to receive(:head_pipeline) - .and_return(pipeline) + allow(mr_merge_if_green_enabled).to receive(:head_pipeline). + and_return(pipeline) - allow(mr_merge_if_green_enabled).to receive(:mergeable?) - .and_return(true) + allow(mr_merge_if_green_enabled).to receive(:mergeable?). + and_return(true) allow(pipeline).to receive(:success?).and_return(true) end @@ -152,9 +152,9 @@ describe MergeRequests::MergeWhenPipelineSucceedsService do before do # This behavior of MergeRequest: we instantiate a new object # - allow_any_instance_of(MergeRequest) - .to receive(:head_pipeline) - .and_wrap_original do + allow_any_instance_of(MergeRequest). + to receive(:head_pipeline). + and_wrap_original do Ci::Pipeline.find(pipeline.id) end end diff --git a/spec/services/merge_requests/refresh_service_spec.rb b/spec/services/merge_requests/refresh_service_spec.rb index af951588fc6..983dac6efdb 100644 --- a/spec/services/merge_requests/refresh_service_spec.rb +++ b/spec/services/merge_requests/refresh_service_spec.rb @@ -56,8 +56,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) end it { expect(@merge_request.notes).not_to be_empty } @@ -115,8 +115,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) end it { expect(@merge_request.notes).to be_empty } @@ -191,8 +191,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 3fda94a8bc5..a99d4eac9bd 100644 --- a/spec/services/merge_requests/reopen_service_spec.rb +++ b/spec/services/merge_requests/reopen_service_spec.rb @@ -29,8 +29,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/resolve_service_spec.rb b/spec/services/merge_requests/resolve_service_spec.rb index b7f475597b4..57b1c088ce4 100644 --- a/spec/services/merge_requests/resolve_service_spec.rb +++ b/spec/services/merge_requests/resolve_service_spec.rb @@ -58,8 +58,8 @@ describe MergeRequests::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 + expect(merge_request.source_branch_head.parents.map(&:id)). + to eq(%w(1450cd639e0bc6721eb02800169e464f212cde06 824be604a34828eb682305f0d963056cfac87b2d)) end end @@ -84,8 +84,8 @@ describe MergeRequests::ResolveService do end it 'creates a commit with the correct parents' do - expect(merge_request_from_fork.source_branch_head.parents.map(&:id)) - .to eq(['404fa3fc7c2c9b5dacff102f353bdf55b1be2813', + expect(merge_request_from_fork.source_branch_head.parents.map(&:id)). + to eq(['404fa3fc7c2c9b5dacff102f353bdf55b1be2813', target_head]) end end @@ -124,8 +124,8 @@ describe MergeRequests::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 + expect(merge_request.source_branch_head.parents.map(&:id)). + to eq(%w(1450cd639e0bc6721eb02800169e464f212cde06 824be604a34828eb682305f0d963056cfac87b2d)) end @@ -158,8 +158,8 @@ describe MergeRequests::ResolveService do let(:service) { MergeRequests::ResolveService.new(project, user, invalid_params) } it 'raises a MissingResolution error' do - expect { service.execute(merge_request) } - .to raise_error(Gitlab::Conflict::File::MissingResolution) + expect { service.execute(merge_request) }. + to raise_error(Gitlab::Conflict::File::MissingResolution) end end @@ -184,8 +184,8 @@ describe MergeRequests::ResolveService do let(:service) { MergeRequests::ResolveService.new(project, user, invalid_params) } it 'raises a MissingResolution error' do - expect { service.execute(merge_request) } - .to raise_error(Gitlab::Conflict::File::MissingResolution) + expect { service.execute(merge_request) }. + to raise_error(Gitlab::Conflict::File::MissingResolution) end end @@ -206,8 +206,8 @@ describe MergeRequests::ResolveService do let(:service) { MergeRequests::ResolveService.new(project, user, invalid_params) } it 'raises a MissingFiles error' do - expect { service.execute(merge_request) } - .to raise_error(MergeRequests::ResolveService::MissingFiles) + expect { service.execute(merge_request) }. + to raise_error(MergeRequests::ResolveService::MissingFiles) end end end diff --git a/spec/services/merge_requests/update_service_spec.rb b/spec/services/merge_requests/update_service_spec.rb index b67874ed4c3..7d73c0ea5d0 100644 --- a/spec/services/merge_requests/update_service_spec.rb +++ b/spec/services/merge_requests/update_service_spec.rb @@ -68,8 +68,8 @@ describe MergeRequests::UpdateService, services: true do it { expect(@merge_request.merge_params['force_remove_source_branch']).to eq('1') } 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 @@ -171,8 +171,8 @@ describe MergeRequests::UpdateService, services: true do ref: merge_request.source_branch, sha: merge_request.diff_head_sha) - 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 |