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
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-05-19 18:44:42 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-05-19 18:44:42 +0300
commit4555e1b21c365ed8303ffb7a3325d773c9b8bf31 (patch)
tree5423a1c7516cffe36384133ade12572cf709398d /spec/features/projects/compare_spec.rb
parente570267f2f6b326480d284e0164a6464ba4081bc (diff)
Add latest changes from gitlab-org/gitlab@13-12-stable-eev13.12.0-rc42
Diffstat (limited to 'spec/features/projects/compare_spec.rb')
-rw-r--r--spec/features/projects/compare_spec.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/features/projects/compare_spec.rb b/spec/features/projects/compare_spec.rb
index 64e9968061c..bc3ef2af9b0 100644
--- a/spec/features/projects/compare_spec.rb
+++ b/spec/features/projects/compare_spec.rb
@@ -118,6 +118,34 @@ RSpec.describe "Compare", :js do
end
end
end
+
+ context "pagination" do
+ before do
+ stub_const("Projects::CompareController::COMMIT_DIFFS_PER_PAGE", 1)
+ end
+
+ it "shows an adjusted count for changed files on this page" do
+ visit project_compare_index_path(project, from: "feature", to: "master")
+
+ click_button('Compare')
+
+ expect(page).to have_content("Showing 1 changed file")
+ end
+
+ it "shows commits list only on the first page" do
+ visit project_compare_index_path(project, from: "feature", to: "master")
+ click_button('Compare')
+
+ expect(page).to have_content 'Commits (29)'
+
+ # go to the second page
+ within(".files .gl-pagination") do
+ click_on("2")
+ end
+
+ expect(page).not_to have_content 'Commits (29)'
+ end
+ end
end
describe "tags" do