diff options
author | Jacob Vosmaer <jacob@gitlab.com> | 2017-09-13 19:16:56 +0300 |
---|---|---|
committer | Jacob Vosmaer <jacob@gitlab.com> | 2017-09-14 18:42:02 +0300 |
commit | 9e40baba1ebad260fa53b4a1de0c11e699d7c6a2 (patch) | |
tree | f6de30f8fc750fced4bc006895f00f2a0853029f /spec/models/repository_spec.rb | |
parent | 1f5ae8cd8b3663ea2de883ec4605dc4100465bf4 (diff) |
Rename Gitlab::Git::Committer to User
Diffstat (limited to 'spec/models/repository_spec.rb')
-rw-r--r-- | spec/models/repository_spec.rb | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/spec/models/repository_spec.rb b/spec/models/repository_spec.rb index 7065d467ec0..53280f2c1cf 100644 --- a/spec/models/repository_spec.rb +++ b/spec/models/repository_spec.rb @@ -8,7 +8,7 @@ describe Repository, models: true do let(:repository) { project.repository } let(:broken_repository) { create(:project, :broken_storage).repository } let(:user) { create(:user) } - let(:committer) { Gitlab::Git::Committer.from_user(user) } + let(:git_user) { Gitlab::Git::User.from_gitlab(user) } let(:commit_options) do author = repository.user_to_committer(user) @@ -886,7 +886,7 @@ describe Repository, models: true do context 'when pre hooks were successful' do it 'runs without errors' do expect_any_instance_of(Gitlab::Git::HooksService).to receive(:execute) - .with(committer, repository.raw_repository, old_rev, blank_sha, 'refs/heads/feature') + .with(git_user, repository.raw_repository, old_rev, blank_sha, 'refs/heads/feature') expect { repository.rm_branch(user, 'feature') }.not_to raise_error end @@ -932,20 +932,20 @@ describe Repository, models: true do service = Gitlab::Git::HooksService.new expect(Gitlab::Git::HooksService).to receive(:new).and_return(service) expect(service).to receive(:execute) - .with(committer, target_repository.raw_repository, old_rev, new_rev, updating_ref) + .with(git_user, target_repository.raw_repository, old_rev, new_rev, updating_ref) .and_yield(service).and_return(true) end it 'runs without errors' do expect do - Gitlab::Git::OperationService.new(committer, repository.raw_repository).with_branch('feature') do + Gitlab::Git::OperationService.new(git_user, repository.raw_repository).with_branch('feature') do new_rev end end.not_to raise_error end it 'ensures the autocrlf Git option is set to :input' do - service = Gitlab::Git::OperationService.new(committer, repository.raw_repository) + service = Gitlab::Git::OperationService.new(git_user, repository.raw_repository) expect(service).to receive(:update_autocrlf_option) @@ -956,7 +956,7 @@ describe Repository, models: true do it 'updates the head' do expect(repository.find_branch('feature').dereferenced_target.id).to eq(old_rev) - Gitlab::Git::OperationService.new(committer, repository.raw_repository).with_branch('feature') do + Gitlab::Git::OperationService.new(git_user, repository.raw_repository).with_branch('feature') do new_rev end @@ -974,7 +974,7 @@ describe Repository, models: true do expect(target_project.repository.raw_repository).to receive(:fetch_ref) .and_call_original - Gitlab::Git::OperationService.new(committer, target_repository.raw_repository) + Gitlab::Git::OperationService.new(git_user, target_repository.raw_repository) .with_branch( 'master', start_repository: project.repository.raw_repository, @@ -990,7 +990,7 @@ describe Repository, models: true do it 'does not fetch_ref and just pass the commit' do expect(target_repository).not_to receive(:fetch_ref) - Gitlab::Git::OperationService.new(committer, target_repository.raw_repository) + Gitlab::Git::OperationService.new(git_user, target_repository.raw_repository) .with_branch('feature', start_repository: project.repository.raw_repository) { new_rev } end end @@ -1009,7 +1009,7 @@ describe Repository, models: true do end expect do - Gitlab::Git::OperationService.new(committer, target_project.repository.raw_repository) + Gitlab::Git::OperationService.new(git_user, target_project.repository.raw_repository) .with_branch('feature', start_repository: project.repository.raw_repository, &:itself) @@ -1031,7 +1031,7 @@ describe Repository, models: true do repository.add_branch(user, branch, old_rev) expect do - Gitlab::Git::OperationService.new(committer, repository.raw_repository).with_branch(branch) do + Gitlab::Git::OperationService.new(git_user, repository.raw_repository).with_branch(branch) do new_rev end end.not_to raise_error @@ -1049,7 +1049,7 @@ describe Repository, models: true do # Updating 'master' to new_rev would lose the commits on 'master' that # are not contained in new_rev. This should not be allowed. expect do - Gitlab::Git::OperationService.new(committer, repository.raw_repository).with_branch(branch) do + Gitlab::Git::OperationService.new(git_user, repository.raw_repository).with_branch(branch) do new_rev end end.to raise_error(Gitlab::Git::CommitError) @@ -1061,7 +1061,7 @@ describe Repository, models: true do allow_any_instance_of(Gitlab::Git::Hook).to receive(:trigger).and_return([false, '']) expect do - Gitlab::Git::OperationService.new(committer, repository.raw_repository).with_branch('feature') do + Gitlab::Git::OperationService.new(git_user, repository.raw_repository).with_branch('feature') do new_rev end end.to raise_error(Gitlab::Git::HooksService::PreReceiveError) |