summaryrefslogtreecommitdiff
path: root/spec/models/concerns
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2018-12-20 15:24:25 +0100
committerDouwe Maan <douwe@selenight.nl>2018-12-20 16:40:51 +0100
commit047b7e506e2603f33ecf14fea43969ccb2954a82 (patch)
tree4cc695ec40e6d3ee2433b624b8bec7bd11df5c09 /spec/models/concerns
parentf6dd6e566a2c656f97cf7c78df482bd4ec77d006 (diff)
downloadgitlab-ce-047b7e506e2603f33ecf14fea43969ccb2954a82.tar.gz
Allow truncated_diff_lines to be called on image diff discussion
Diffstat (limited to 'spec/models/concerns')
-rw-r--r--spec/models/concerns/discussion_on_diff_spec.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/spec/models/concerns/discussion_on_diff_spec.rb b/spec/models/concerns/discussion_on_diff_spec.rb
index 73eb7a1160d..4b16e6e3902 100644
--- a/spec/models/concerns/discussion_on_diff_spec.rb
+++ b/spec/models/concerns/discussion_on_diff_spec.rb
@@ -50,11 +50,17 @@ describe DiscussionOnDiff do
end
context "when the diff line does not exist on a legacy diff note" do
+ subject { create(:legacy_diff_note_on_merge_request).to_discussion }
+
it "returns an empty array" do
- legacy_note = LegacyDiffNote.new
+ expect(truncated_lines).to eq([])
+ end
+ end
- allow(subject).to receive(:first_note).and_return(legacy_note)
+ context 'when the discussion is on an image' do
+ subject { create(:image_diff_note_on_merge_request).to_discussion }
+ it 'returns an empty array' do
expect(truncated_lines).to eq([])
end
end