summaryrefslogtreecommitdiff
path: root/spec/helpers
diff options
context:
space:
mode:
authorPaco Guzman <pacoguzmanp@gmail.com>2016-07-15 09:04:18 +0200
committerDouwe Maan <douwe@selenight.nl>2016-07-18 14:43:28 -0600
commita404ab380db5959ab22b09bc586607b1f6c507cd (patch)
tree68cadd8516a1db0997dfa09e8fafd12b35391d78 /spec/helpers
parent65352b5baaf269a609b024fd13efc81e8bbdcefa (diff)
downloadgitlab-ce-a404ab380db5959ab22b09bc586607b1f6c507cd.tar.gz
Collapsed diffs lines/size don't accumulate to overflow diffs.19820-safer-diffs
Diffstat (limited to 'spec/helpers')
-rw-r--r--spec/helpers/diff_helper_spec.rb23
1 files changed, 21 insertions, 2 deletions
diff --git a/spec/helpers/diff_helper_spec.rb b/spec/helpers/diff_helper_spec.rb
index 4b134a48410..c2fd2c8a533 100644
--- a/spec/helpers/diff_helper_spec.rb
+++ b/spec/helpers/diff_helper_spec.rb
@@ -30,12 +30,31 @@ describe DiffHelper do
expect(helper.diff_view).to eq 'inline'
end
end
-
+
describe 'diff_options' do
- it 'should return hard limit for a diff' do
+ it 'should return hard limit for a diff if force diff is true' do
allow(controller).to receive(:params) { { force_show_diff: true } }
expect(diff_options).to include(Commit.max_diff_options)
end
+
+ it 'should return hard limit for a diff if expand_all_diffs is true' do
+ allow(controller).to receive(:params) { { expand_all_diffs: true } }
+ expect(diff_options).to include(Commit.max_diff_options)
+ end
+
+ it 'should return no collapse false' do
+ expect(diff_options).to include(no_collapse: false)
+ end
+
+ it 'should return no collapse true if expand_all_diffs' do
+ allow(controller).to receive(:params) { { expand_all_diffs: true } }
+ expect(diff_options).to include(no_collapse: true)
+ end
+
+ it 'should return no collapse true if action name diff_for_path' do
+ allow(controller).to receive(:action_name) { 'diff_for_path' }
+ expect(diff_options).to include(no_collapse: true)
+ end
end
describe 'unfold_bottom_class' do