Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Vosmaer <jacob@gitlab.com>2016-09-07 17:28:26 +0300
committerJacob Vosmaer <jacob@gitlab.com>2016-09-07 17:28:26 +0300
commit0f08bb86d8731edd40f9348335987f55a4ba9f11 (patch)
tree3ef42fe2924bb49509a48df81b66a78f9a858f5f /spec/models/repository_spec.rb
parenta75026915863280c78fe73211e423bf6f4ce11c4 (diff)
Rename {commit,update_branch}_with_hooks
Diffstat (limited to 'spec/models/repository_spec.rb')
-rw-r--r--spec/models/repository_spec.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/spec/models/repository_spec.rb b/spec/models/repository_spec.rb
index 17eecf6bbd6..bc899027d6b 100644
--- a/spec/models/repository_spec.rb
+++ b/spec/models/repository_spec.rb
@@ -441,7 +441,7 @@ describe Repository, models: true do
end
end
- describe '#commit_with_hooks' do
+ describe '#update_branch_with_hooks' do
let(:old_rev) { '0b4bc9a49b562e85de7cc9e834518ea6828729b9' } # git rev-parse feature
let(:new_rev) { 'a74ae73c1ccde9b974a70e82b901588071dc142a' } # commit whose parent is old_rev
@@ -454,20 +454,20 @@ describe Repository, models: true do
it 'runs without errors' do
expect do
- repository.commit_with_hooks(user, 'feature') { new_rev }
+ repository.update_branch_with_hooks(user, 'feature') { new_rev }
end.not_to raise_error
end
it 'ensures the autocrlf Git option is set to :input' do
expect(repository).to receive(:update_autocrlf_option)
- repository.commit_with_hooks(user, 'feature') { new_rev }
+ repository.update_branch_with_hooks(user, 'feature') { new_rev }
end
context "when the branch wasn't empty" do
it 'updates the head' do
expect(repository.find_branch('feature').target.id).to eq(old_rev)
- repository.commit_with_hooks(user, 'feature') { new_rev }
+ repository.update_branch_with_hooks(user, 'feature') { new_rev }
expect(repository.find_branch('feature').target.id).to eq(new_rev)
end
end
@@ -479,7 +479,7 @@ describe Repository, models: true do
branch = 'feature-ff-target'
repository.add_branch(user, branch, old_rev)
- expect { repository.commit_with_hooks(user, branch) { new_rev } }.not_to raise_error
+ expect { repository.update_branch_with_hooks(user, branch) { new_rev } }.not_to raise_error
end
end
@@ -488,7 +488,7 @@ describe Repository, models: true do
# We use the fact that 'master' has diverged from 'feature' (new_rev):
# updating 'master' to new_rev would make us lose commits, which should
# not happen.
- expect { repository.commit_with_hooks(user, 'master') { new_rev } }.to raise_error(Repository::CommitError)
+ expect { repository.update_branch_with_hooks(user, 'master') { new_rev } }.to raise_error(Repository::CommitError)
end
end
@@ -497,7 +497,7 @@ describe Repository, models: true do
allow_any_instance_of(Gitlab::Git::Hook).to receive(:trigger).and_return([false, ''])
expect do
- repository.commit_with_hooks(user, 'feature') { new_rev }
+ repository.update_branch_with_hooks(user, 'feature') { new_rev }
end.to raise_error(GitHooksService::PreReceiveError)
end
end
@@ -516,7 +516,7 @@ describe Repository, models: true do
expect(repository).to receive(:expire_has_visible_content_cache)
expect(repository).to receive(:expire_branch_count_cache)
- repository.commit_with_hooks(user, 'new-feature') { new_rev }
+ repository.update_branch_with_hooks(user, 'new-feature') { new_rev }
end
end