diff options
author | Oswaldo Ferreira <oswaldo@gitlab.com> | 2018-11-08 00:57:26 +0300 |
---|---|---|
committer | Oswaldo Ferreira <oswaldo@gitlab.com> | 2018-11-08 00:57:26 +0300 |
commit | 198402b38b59a43aa6e50259d7c13c0097dbdfac (patch) | |
tree | 972469d726a9fc38fa990ed6a5b29d9e91b409f6 /spec/lib/gitlab/diff/file_spec.rb | |
parent | 8467167bbc7fb16e25b202c6eda37a9fe1f1a9d7 (diff) |
Revert "Merge branch 'osw-comment-on-any-line-on-diffs' into 'master'"
This reverts commit a82a595728d54bdc12e51dfcfb22e9eddc449143, reversing
changes made to e7df959b8f99875edd246c7ac7779c3203e8755e.
Diffstat (limited to 'spec/lib/gitlab/diff/file_spec.rb')
-rw-r--r-- | spec/lib/gitlab/diff/file_spec.rb | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/spec/lib/gitlab/diff/file_spec.rb b/spec/lib/gitlab/diff/file_spec.rb index 3417896e259..2f51642b58e 100644 --- a/spec/lib/gitlab/diff/file_spec.rb +++ b/spec/lib/gitlab/diff/file_spec.rb @@ -41,52 +41,6 @@ describe Gitlab::Diff::File do end end - describe '#unfold_diff_lines' do - let(:unfolded_lines) { double('expanded-lines') } - let(:unfolder) { instance_double(Gitlab::Diff::LinesUnfolder) } - let(:position) { instance_double(Gitlab::Diff::Position, old_line: 10) } - - before do - allow(Gitlab::Diff::LinesUnfolder).to receive(:new) { unfolder } - end - - context 'when unfold required' do - before do - allow(unfolder).to receive(:unfold_required?) { true } - allow(unfolder).to receive(:unfolded_diff_lines) { unfolded_lines } - end - - it 'changes @unfolded to true' do - diff_file.unfold_diff_lines(position) - - expect(diff_file).to be_unfolded - end - - it 'updates @diff_lines' do - diff_file.unfold_diff_lines(position) - - expect(diff_file.diff_lines).to eq(unfolded_lines) - end - end - - context 'when unfold not required' do - before do - allow(unfolder).to receive(:unfold_required?) { false } - end - - it 'keeps @unfolded false' do - diff_file.unfold_diff_lines(position) - - expect(diff_file).not_to be_unfolded - end - - it 'does not update @diff_lines' do - expect { diff_file.unfold_diff_lines(position) } - .not_to change(diff_file, :diff_lines) - end - end - end - describe '#mode_changed?' do it { expect(diff_file.mode_changed?).to be_falsey } end |