summaryrefslogtreecommitdiff
path: root/spec/models
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2017-05-01 13:35:51 +0000
committerSean McGivern <sean@mcgivern.me.uk>2017-05-01 13:35:51 +0000
commit3f8ead1a588616f421745773b1600a6e77f1c133 (patch)
treeb529c1d0b7d60f01bf6324a1980ec56d7c171b5e /spec/models
parentd4aeda2036b35ecf950f6117febb186e38c0281c (diff)
parentfe771b51fd80dd0926a31091b18a935a01fe1296 (diff)
downloadgitlab-ce-3f8ead1a588616f421745773b1600a6e77f1c133.tar.gz
Merge branch '30586-fix-gitaly-is-ancestor' into 'master' 31611-sketch43-click-opens-new-tab-and-closes-it-quickly
Fix Gitaly::Commit#is_ancestor Closes #30586 See merge request !10634
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/repository_spec.rb24
1 files changed, 11 insertions, 13 deletions
diff --git a/spec/models/repository_spec.rb b/spec/models/repository_spec.rb
index 98d0641443e..f6846cc1b2f 100644
--- a/spec/models/repository_spec.rb
+++ b/spec/models/repository_spec.rb
@@ -1849,17 +1849,15 @@ describe Repository, models: true do
end
end
- # TODO: Uncomment when feature is reenabled
- # 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
+ describe '#is_ancestor?' do
+ context 'Gitaly is_ancestor feature enabled' do
+ it "asks Gitaly server if it's an ancestor" do
+ commit = repository.commit
+ expect(repository.raw_repository).to receive(:is_ancestor?).and_call_original
+ allow(Gitlab::GitalyClient).to receive(:feature_enabled?).with(:is_ancestor).and_return(true)
+
+ expect(repository.is_ancestor?(commit.id, commit.id)).to be true
+ end
+ end
+ end
end