diff options
author | Robert Speicher <robert@gitlab.com> | 2017-04-02 20:36:25 +0300 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2017-04-02 20:36:25 +0300 |
commit | e7e9307219d1c81427f95444b36471c519dc06c2 (patch) | |
tree | 234d8b8d0674898e6538dbc65a0b81720e45a2cf /spec | |
parent | fee49c995e1ba1f182fa8121ca833d06419b25e1 (diff) | |
parent | 1ea0ce827a619007c69010da512cb4e82224ed0f (diff) |
Merge branch 'use-gitaly-commit-is-ancestor' into 'master'
Use gitaly commit is ancestor
See merge request !9864
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/repository_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/models/repository_spec.rb b/spec/models/repository_spec.rb index 585b87b828d..df742ee8084 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.raw_repository, commit.id, commit.id).and_return(true) + + expect(repository.is_ancestor?(commit.id, commit.id)).to be true + end + end + end end |