summaryrefslogtreecommitdiff
path: root/spec/features/projects/compare_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/features/projects/compare_spec.rb')
-rw-r--r--spec/features/projects/compare_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/features/projects/compare_spec.rb b/spec/features/projects/compare_spec.rb
index 69600884909..5f7cf68987e 100644
--- a/spec/features/projects/compare_spec.rb
+++ b/spec/features/projects/compare_spec.rb
@@ -87,6 +87,21 @@ describe "Compare", :js do
expect(find(".js-compare-from-dropdown .dropdown-content")).to have_selector("li", count: 3)
end
+
+ context 'when commit has overflow', :js do
+ it 'displays warning' do
+ visit project_compare_index_path(project, from: "feature", to: "master")
+
+ allow(Commit).to receive(:max_diff_options).and_return(max_files: 3)
+ allow_any_instance_of(DiffHelper).to receive(:render_overflow_warning?).and_return(true)
+
+ click_button('Compare')
+
+ page.within('.alert') do
+ expect(page).to have_text("Too many changes to show. To preserve performance only 3 of 3+ files are displayed.")
+ end
+ end
+ end
end
describe "tags" do