From 34cd10979757cdad26056a532cf09c59a7f74ae9 Mon Sep 17 00:00:00 2001 From: Ahmad Sherif Date: Fri, 21 Apr 2017 15:02:21 +0200 Subject: Re-enable Gitaly commit_raw_diff feature --- spec/models/commit_spec.rb | 55 +++++++++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 28 deletions(-) (limited to 'spec/models/commit_spec.rb') diff --git a/spec/models/commit_spec.rb b/spec/models/commit_spec.rb index 08b2169fea7..852889d4540 100644 --- a/spec/models/commit_spec.rb +++ b/spec/models/commit_spec.rb @@ -389,32 +389,31 @@ eos end end - # describe '#raw_diffs' do - # TODO: Uncomment when feature is reenabled - # context 'Gitaly commit_raw_diffs feature enabled' do - # before do - # allow(Gitlab::GitalyClient).to receive(:feature_enabled?).with(:commit_raw_diffs).and_return(true) - # end - # - # context 'when a truthy deltas_only is not passed to args' do - # it 'fetches diffs from Gitaly server' do - # expect(Gitlab::GitalyClient::Commit).to receive(:diff_from_parent). - # with(commit) - # - # commit.raw_diffs - # end - # end - # - # context 'when a truthy deltas_only is passed to args' do - # it 'fetches diffs using Rugged' do - # opts = { deltas_only: true } - # - # expect(Gitlab::GitalyClient::Commit).not_to receive(:diff_from_parent) - # expect(commit.raw).to receive(:diffs).with(opts) - # - # commit.raw_diffs(opts) - # end - # end - # end - # end + describe '#raw_diffs' do + context 'Gitaly commit_raw_diffs feature enabled' do + before do + allow(Gitlab::GitalyClient).to receive(:feature_enabled?).with(:commit_raw_diffs).and_return(true) + end + + context 'when a truthy deltas_only is not passed to args' do + it 'fetches diffs from Gitaly server' do + expect(Gitlab::GitalyClient::Commit).to receive(:diff_from_parent). + with(commit) + + commit.raw_diffs + end + end + + context 'when a truthy deltas_only is passed to args' do + it 'fetches diffs using Rugged' do + opts = { deltas_only: true } + + expect(Gitlab::GitalyClient::Commit).not_to receive(:diff_from_parent) + expect(commit.raw).to receive(:diffs).with(opts) + + commit.raw_diffs(opts) + end + end + end + end end -- cgit v1.2.1