diff options
author | Kim "BKC" Carlbäcker <kim.carlbacker@gmail.com> | 2017-03-15 16:40:31 +0100 |
---|---|---|
committer | Kim "BKC" Carlbäcker <kim.carlbacker@gmail.com> | 2017-03-15 16:40:31 +0100 |
commit | 193c0714910065144d6363b16429e558dc536d9e (patch) | |
tree | 9af5da9480c1d657b21d826bb67258f61e82efe8 | |
parent | c064e6b562c51fd97b7607da723a35c76cd79e57 (diff) | |
download | gitlab-ce-use-gitaly-commit-is-ancestor.tar.gz |
Move the tests to repository_spec.rbuse-gitaly-commit-is-ancestor
-rw-r--r-- | spec/models/deployment_spec.rb | 11 | ||||
-rw-r--r-- | spec/models/repository_spec.rb | 13 |
2 files changed, 13 insertions, 11 deletions
diff --git a/spec/models/deployment_spec.rb b/spec/models/deployment_spec.rb index fa68b3072da..080ff2f3f43 100644 --- a/spec/models/deployment_spec.rb +++ b/spec/models/deployment_spec.rb @@ -47,17 +47,6 @@ describe Deployment, models: true do expect(deployment.includes_commit?(commit)).to be false end end - - context 'Gitaly is_ancestor feature enabled' do - it 'asks Gitaly server if it\'s an ancestor' do - commit = project.commit - allow(Gitlab::GitalyClient).to receive(:feature_enabled?).with(:is_ancestor).and_return(true) - expect(Gitlab::GitalyClient::Commit).to receive(:is_ancestor). - with(project.repository, commit.id, commit.id).and_return(true) - - expect(deployment.includes_commit?(commit)).to be true - end - end end describe '#stop_action' do diff --git a/spec/models/repository_spec.rb b/spec/models/repository_spec.rb index 274e4f00a0a..efc4466bc5c 100644 --- a/spec/models/repository_spec.rb +++ b/spec/models/repository_spec.rb @@ -1851,4 +1851,17 @@ describe Repository, models: true do end end end + + describe '#is_ancestor?' do + context 'Gitaly is_ancestor feature enabled' do + it 'asks Gitaly server if it\'s an ancestor' do + commit = repository.commit + allow(Gitlab::GitalyClient).to receive(:feature_enabled?).with(:is_ancestor).and_return(true) + expect(Gitlab::GitalyClient::Commit).to receive(:is_ancestor). + with(repository, commit.id, commit.id).and_return(true) + + expect(repository.is_ancestor?(commit.id, commit.id)).to be true + end + end + end end |