diff options
author | Robert Speicher <robert@gitlab.com> | 2017-12-22 21:04:27 +0300 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2017-12-22 21:04:27 +0300 |
commit | 255e64ef61b7f1555db1230d099095642e1dcc46 (patch) | |
tree | 37677c9c31f72a9e0f11589446940ba8ef7411da /spec | |
parent | 8a488a02ce9cf6ea6cbddbb57991548e35cb3a0c (diff) | |
parent | 771bf9527ffd5fd8fe258381593f686d5d960a42 (diff) |
Merge branch 'dm-diff-note-for-line-performance' into 'master'
Improve performance of DiffDiscussion#truncated_diff_lines and DiffNote#diff_line by removing expensive diff position calculation and comparison
Closes #41406
See merge request gitlab-org/gitlab-ce!16111
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/diff_note_spec.rb | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/spec/models/diff_note_spec.rb b/spec/models/diff_note_spec.rb index 4d0b3245a13..2705421e540 100644 --- a/spec/models/diff_note_spec.rb +++ b/spec/models/diff_note_spec.rb @@ -112,22 +112,6 @@ describe DiffNote do end end - describe "#for_line?" do - context "when provided the correct diff line" do - it "returns true" do - expect(subject.for_line?(subject.diff_line)).to be true - end - end - - context "when provided a different diff line" do - it "returns false" do - some_line = subject.diff_file.diff_lines.first - - expect(subject.for_line?(some_line)).to be false - end - end - end - describe "#active?" do context "when noteable is a commit" do subject { build(:diff_note_on_commit, project: project, position: position) } |