debian-mirror-gitlab/spec/features/users/projects_spec.rb

30 lines
632 B
Ruby
Raw Normal View History

2017-08-17 22:00:37 +05:30
require 'spec_helper'
2017-09-10 17:25:29 +05:30
describe 'Projects tab on a user profile', :js do
2017-08-17 22:00:37 +05:30
let(:user) { create(:user) }
2017-09-10 17:25:29 +05:30
let!(:project) { create(:project, namespace: user.namespace) }
let!(:project2) { create(:project, namespace: user.namespace) }
2017-08-17 22:00:37 +05:30
before do
allow(Project).to receive(:default_per_page).and_return(1)
2017-09-10 17:25:29 +05:30
sign_in(user)
2017-08-17 22:00:37 +05:30
visit user_path(user)
page.within('.user-profile-nav') do
click_link('Personal projects')
end
2017-09-10 17:25:29 +05:30
wait_for_requests
2017-08-17 22:00:37 +05:30
end
it 'paginates results' do
expect(page).to have_content(project2.name)
click_link('Next')
expect(page).to have_content(project.name)
end
end