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:
authorSean McGivern <sean@gitlab.com>2016-09-02 14:29:05 +0300
committerSean McGivern <sean@gitlab.com>2016-09-02 18:24:30 +0300
commite119f994d779878e49d8e1d785725e80b2c48b27 (patch)
tree1790cf12cbfb32e9c6f844c760198344ddc42d02 /spec/features/users
parentfaac71215789cb8224c14be0a4fcbe252a99fa4f (diff)
Fix pagination on user snippets page
Diffstat (limited to 'spec/features/users')
-rw-r--r--spec/features/users/snippets_spec.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/features/users/snippets_spec.rb b/spec/features/users/snippets_spec.rb
new file mode 100644
index 00000000000..356a8d668b0
--- /dev/null
+++ b/spec/features/users/snippets_spec.rb
@@ -0,0 +1,29 @@
+require 'spec_helper'
+
+describe 'Snippets tab on a user profile', feature: true, js: true do
+ include WaitForAjax
+
+ let(:user) { create(:user) }
+
+ context 'when the user has snippets' do
+ before do
+ create_list(:snippet, 25, :public, author: user)
+
+ visit user_path(user)
+ page.within('.user-profile-nav') { click_link 'Snippets' }
+ wait_for_ajax
+ end
+
+ it 'is limited to 20 items per page' do
+ expect(page.all('.snippets-list-holder .snippet-row').count).to eq(20)
+ end
+
+ context 'clicking on the link to the second page' do
+ before { click_link('2') }
+
+ it 'shows the remaining snippets' do
+ expect(page.all('.snippets-list-holder .snippet-row').count).to eq(5)
+ end
+ end
+ end
+end