diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2016-03-11 19:40:59 +0300 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2016-03-18 14:30:46 +0300 |
commit | 3f0d780c19d821e74a4a89634ada10dedec0dbeb (patch) | |
tree | 0a0b57dc7d57ea039d3678fca8aa2b8142c7d592 /spec/lib/gitlab/diff | |
parent | bdbc9884348515f71530efc2759c05d794f8547e (diff) |
Show a notice for diffs that are too large
This builds on the changes introduced in
https://gitlab.com/gitlab-org/gitlab_git/merge_requests/72 and results
in merge requests with large diffs (e.g. due to them containing minified
CSS) loading much faster.
Diffstat (limited to 'spec/lib/gitlab/diff')
-rw-r--r-- | spec/lib/gitlab/diff/file_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/lib/gitlab/diff/file_spec.rb b/spec/lib/gitlab/diff/file_spec.rb index 0d9694f2c13..a0cbef6e6a4 100644 --- a/spec/lib/gitlab/diff/file_spec.rb +++ b/spec/lib/gitlab/diff/file_spec.rb @@ -18,4 +18,18 @@ describe Gitlab::Diff::File, lib: true do describe :mode_changed? do it { expect(diff_file.mode_changed?).to be_falsey } end + + describe '#too_large?' do + it 'returns true for a file that is too large' do + expect(diff).to receive(:too_large?).and_return(true) + + expect(diff_file.too_large?).to eq(true) + end + + it 'returns false for a file that is small enough' do + expect(diff).to receive(:too_large?).and_return(false) + + expect(diff_file.too_large?).to eq(false) + end + end end |