diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-04-05 01:27:23 +0300 |
---|---|---|
committer | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-04-05 19:44:14 +0300 |
commit | c319f2114177f011cd0c6c23b04f7c19971268bf (patch) | |
tree | b91a2ace5426bea9a7c6a60eabbd44da394fa80c /spec/models/diff_discussion_spec.rb | |
parent | afa53810deab37c95da245510a7cf85e8846a162 (diff) |
Address review comments
Diffstat (limited to 'spec/models/diff_discussion_spec.rb')
-rw-r--r-- | spec/models/diff_discussion_spec.rb | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/spec/models/diff_discussion_spec.rb b/spec/models/diff_discussion_spec.rb index ba7dd5280bd..48e7c0a822c 100644 --- a/spec/models/diff_discussion_spec.rb +++ b/spec/models/diff_discussion_spec.rb @@ -4,8 +4,10 @@ describe DiffDiscussion, model: true do subject { described_class.new([first_note, second_note, third_note]) } let(:first_note) { create(:diff_note_on_merge_request) } - let(:second_note) { create(:diff_note_on_merge_request, in_reply_to: first_note) } - let(:third_note) { create(:diff_note_on_merge_request, in_reply_to: first_note) } + let(:merge_request) { first_note.noteable } + let(:project) { first_note.project } + let(:second_note) { create(:diff_note_on_merge_request, noteable: merge_request, project: project, in_reply_to: first_note) } + let(:third_note) { create(:diff_note_on_merge_request, noteable: merge_request, project: project, in_reply_to: first_note) } describe '#reply_attributes' do it 'includes position and original_position' do @@ -14,23 +16,4 @@ describe DiffDiscussion, model: true do expect(attributes[:original_position]).to eq(first_note.original_position.to_json) end end - - describe "#truncated_diff_lines" do - let(:truncated_lines) { subject.truncated_diff_lines } - - context "when diff is greater than allowed number of truncated diff lines " do - it "returns fewer lines" do - expect(subject.diff_lines.count).to be > described_class::NUMBER_OF_TRUNCATED_DIFF_LINES - - expect(truncated_lines.count).to be <= described_class::NUMBER_OF_TRUNCATED_DIFF_LINES - end - end - - context "when some diff lines are meta" do - it "returns no meta lines" do - expect(subject.diff_lines).to include(be_meta) - expect(truncated_lines).not_to include(be_meta) - end - end - end end |