Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2016-03-18 15:03:31 +0300
committerRémy Coutable <remy@rymai.me>2016-03-18 22:31:56 +0300
commitf14ee2f248e98c0872b7fbb369f220dcfcd258ac (patch)
tree9716d0ed08b4b1d9fd453c1c79c82bdd9c7c14ff /spec
parent89f7eec1782e2cb084693aead4b22bf07962a681 (diff)
Merge branch 'hide-large-diffs' into 'master'
Show a notice for diffs that are empty/too large This builds upon https://gitlab.com/gitlab-org/gitlab_git/merge_requests/72 but will fail until said MR has been merged. Fixes gitlab-org/gitlab-ce#13912, gitlab-org/gitlab-ce#13644, gitlab-org/gitlab-ce#13557, gitlab-org/gitlab-ce#13267, gitlab-org/gitlab-ce#3906 See merge request !3185
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/gitlab/diff/file_spec.rb14
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