summaryrefslogtreecommitdiff
path: root/spec/models
diff options
context:
space:
mode:
authorValery Sizov <valery@gitlab.com>2016-07-04 15:30:22 +0300
committerValery Sizov <valery@gitlab.com>2016-07-04 15:31:49 +0300
commitbf218337ed5bd535856204ef1878a1495fa37dfe (patch)
tree66415495c994a17fb0c45bcfcb4a3d08d808098f /spec/models
parent021b6aef94b3398ab5603b4c11afd4c6d8432795 (diff)
downloadgitlab-ce-bf218337ed5bd535856204ef1878a1495fa37dfe.tar.gz
Better message for git hooks and file locks
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/repository_spec.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/spec/models/repository_spec.rb b/spec/models/repository_spec.rb
index e753306a31f..7975fc64e59 100644
--- a/spec/models/repository_spec.rb
+++ b/spec/models/repository_spec.rb
@@ -308,14 +308,14 @@ describe Repository, models: true do
describe :add_branch do
context 'when pre hooks were successful' do
it 'should run without errors' do
- hook = double(trigger: true)
+ hook = double(trigger: [true, nil])
expect(Gitlab::Git::Hook).to receive(:new).exactly(3).times.and_return(hook)
expect { repository.add_branch(user, 'new_feature', 'master') }.not_to raise_error
end
it 'should create the branch' do
- allow_any_instance_of(Gitlab::Git::Hook).to receive(:trigger).and_return(true)
+ allow_any_instance_of(Gitlab::Git::Hook).to receive(:trigger).and_return([true, nil])
branch = repository.add_branch(user, 'new_feature', 'master')
@@ -331,7 +331,7 @@ describe Repository, models: true do
context 'when pre hooks failed' do
it 'should get an error' do
- allow_any_instance_of(Gitlab::Git::Hook).to receive(:trigger).and_return(false)
+ allow_any_instance_of(Gitlab::Git::Hook).to receive(:trigger).and_return([false, ''])
expect do
repository.add_branch(user, 'new_feature', 'master')
@@ -339,7 +339,7 @@ describe Repository, models: true do
end
it 'should not create the branch' do
- allow_any_instance_of(Gitlab::Git::Hook).to receive(:trigger).and_return(false)
+ allow_any_instance_of(Gitlab::Git::Hook).to receive(:trigger).and_return([false, ''])
expect do
repository.add_branch(user, 'new_feature', 'master')
@@ -352,13 +352,13 @@ describe Repository, models: true do
describe :rm_branch do
context 'when pre hooks were successful' do
it 'should run without errors' do
- allow_any_instance_of(Gitlab::Git::Hook).to receive(:trigger).and_return(true)
+ allow_any_instance_of(Gitlab::Git::Hook).to receive(:trigger).and_return([true, nil])
expect { repository.rm_branch(user, 'feature') }.not_to raise_error
end
it 'should delete the branch' do
- allow_any_instance_of(Gitlab::Git::Hook).to receive(:trigger).and_return(true)
+ allow_any_instance_of(Gitlab::Git::Hook).to receive(:trigger).and_return([true, nil])
expect { repository.rm_branch(user, 'feature') }.not_to raise_error
@@ -368,7 +368,7 @@ describe Repository, models: true do
context 'when pre hooks failed' do
it 'should get an error' do
- allow_any_instance_of(Gitlab::Git::Hook).to receive(:trigger).and_return(false)
+ allow_any_instance_of(Gitlab::Git::Hook).to receive(:trigger).and_return([false, ''])
expect do
repository.rm_branch(user, 'new_feature')
@@ -376,7 +376,7 @@ describe Repository, models: true do
end
it 'should not delete the branch' do
- allow_any_instance_of(Gitlab::Git::Hook).to receive(:trigger).and_return(false)
+ allow_any_instance_of(Gitlab::Git::Hook).to receive(:trigger).and_return([false, ''])
expect do
repository.rm_branch(user, 'feature')
@@ -408,7 +408,7 @@ describe Repository, models: true do
context 'when pre hooks failed' do
it 'should get an error' do
- allow_any_instance_of(Gitlab::Git::Hook).to receive(:trigger).and_return(false)
+ allow_any_instance_of(Gitlab::Git::Hook).to receive(:trigger).and_return([false, ''])
expect do
repository.commit_with_hooks(user, 'feature') { sample_commit.id }