diff options
Diffstat (limited to 'spec/services/git/branch_push_service_spec.rb')
-rw-r--r-- | spec/services/git/branch_push_service_spec.rb | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/spec/services/git/branch_push_service_spec.rb b/spec/services/git/branch_push_service_spec.rb index fc629fe583d..d70e458ba5e 100644 --- a/spec/services/git/branch_push_service_spec.rb +++ b/spec/services/git/branch_push_service_spec.rb @@ -151,9 +151,9 @@ RSpec.describe Git::BranchPushService, services: true do it "when pushing a new branch for the first time" do expect(UpdateMergeRequestsWorker) .to receive(:perform_async) - .with(project.id, user.id, blankrev, 'newrev', ref) + .with(project.id, user.id, blankrev, newrev, ref) - execute_service(project, user, oldrev: blankrev, newrev: 'newrev', ref: ref) + execute_service(project, user, oldrev: blankrev, newrev: newrev, ref: ref) end end @@ -162,13 +162,13 @@ RSpec.describe Git::BranchPushService, services: true do it "calls the copy attributes method for the first push to the default branch" do expect(project.repository).to receive(:copy_gitattributes).with('master') - execute_service(project, user, oldrev: blankrev, newrev: 'newrev', ref: ref) + execute_service(project, user, oldrev: blankrev, newrev: newrev, ref: ref) end it "calls the copy attributes method for changes to the default branch" do expect(project.repository).to receive(:copy_gitattributes).with(ref) - execute_service(project, user, oldrev: 'oldrev', newrev: 'newrev', ref: ref) + execute_service(project, user, oldrev: oldrev, newrev: newrev, ref: ref) end end @@ -195,7 +195,7 @@ RSpec.describe Git::BranchPushService, services: true do it "when pushing a branch for the first time" do expect(project).to receive(:execute_hooks) expect(project.default_branch).to eq("master") - execute_service(project, user, oldrev: blankrev, newrev: 'newrev', ref: ref) + execute_service(project, user, oldrev: blankrev, newrev: newrev, ref: ref) expect(project.protected_branches).not_to be_empty expect(project.protected_branches.first.push_access_levels.map(&:access_level)).to eq([Gitlab::Access::MAINTAINER]) expect(project.protected_branches.first.merge_access_levels.map(&:access_level)).to eq([Gitlab::Access::MAINTAINER]) @@ -206,7 +206,7 @@ RSpec.describe Git::BranchPushService, services: true do expect(project).to receive(:execute_hooks) expect(project.default_branch).to eq("master") - execute_service(project, user, oldrev: blankrev, newrev: 'newrev', ref: ref) + execute_service(project, user, oldrev: blankrev, newrev: newrev, ref: ref) expect(project.protected_branches).to be_empty end @@ -216,7 +216,7 @@ RSpec.describe Git::BranchPushService, services: true do expect(project).to receive(:execute_hooks) expect(project.default_branch).to eq("master") - execute_service(project, user, oldrev: blankrev, newrev: 'newrev', ref: ref) + execute_service(project, user, oldrev: blankrev, newrev: newrev, ref: ref) expect(project.protected_branches).not_to be_empty expect(project.protected_branches.last.push_access_levels.map(&:access_level)).to eq([Gitlab::Access::DEVELOPER]) @@ -231,7 +231,7 @@ RSpec.describe Git::BranchPushService, services: true do expect(project.default_branch).to eq("master") expect(ProtectedBranches::CreateService).not_to receive(:new) - execute_service(project, user, oldrev: blankrev, newrev: 'newrev', ref: ref) + execute_service(project, user, oldrev: blankrev, newrev: newrev, ref: ref) expect(project.protected_branches).not_to be_empty expect(project.protected_branches.last.push_access_levels.map(&:access_level)).to eq([Gitlab::Access::NO_ACCESS]) @@ -243,7 +243,7 @@ RSpec.describe Git::BranchPushService, services: true do expect(project).to receive(:execute_hooks) expect(project.default_branch).to eq("master") - execute_service(project, user, oldrev: blankrev, newrev: 'newrev', ref: ref) + execute_service(project, user, oldrev: blankrev, newrev: newrev, ref: ref) expect(project.protected_branches).not_to be_empty expect(project.protected_branches.first.push_access_levels.map(&:access_level)).to eq([Gitlab::Access::MAINTAINER]) expect(project.protected_branches.first.merge_access_levels.map(&:access_level)).to eq([Gitlab::Access::DEVELOPER]) @@ -251,7 +251,7 @@ RSpec.describe Git::BranchPushService, services: true do it "when pushing new commits to existing branch" do expect(project).to receive(:execute_hooks) - execute_service(project, user, oldrev: 'oldrev', newrev: 'newrev', ref: ref) + execute_service(project, user, oldrev: oldrev, newrev: newrev, ref: ref) end end end @@ -597,7 +597,7 @@ RSpec.describe Git::BranchPushService, services: true do let(:oldrev) { blankrev } it 'does nothing' do - expect(::Ci::StopEnvironmentsService).not_to receive(:new) + expect(::Environments::StopService).not_to receive(:new) execute_service(project, user, oldrev: oldrev, newrev: newrev, ref: ref) end @@ -605,7 +605,7 @@ RSpec.describe Git::BranchPushService, services: true do context 'update branch' do it 'does nothing' do - expect(::Ci::StopEnvironmentsService).not_to receive(:new) + expect(::Environments::StopService).not_to receive(:new) execute_service(project, user, oldrev: oldrev, newrev: newrev, ref: ref) end @@ -615,10 +615,10 @@ RSpec.describe Git::BranchPushService, services: true do let(:newrev) { blankrev } it 'stops environments' do - expect_next_instance_of(::Ci::StopEnvironmentsService) do |stop_service| + expect_next_instance_of(::Environments::StopService) do |stop_service| expect(stop_service.project).to eq(project) expect(stop_service.current_user).to eq(user) - expect(stop_service).to receive(:execute).with(branch) + expect(stop_service).to receive(:execute_for_branch).with(branch) end execute_service(project, user, oldrev: oldrev, newrev: newrev, ref: ref) |