2017-03-17 11:38:41 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2017-06-29 00:13:10 -04:00
|
|
|
describe 'Projects tab on a user profile', :js do
|
2017-03-17 11:38:41 -04:00
|
|
|
let(:user) { create(:user) }
|
2017-08-02 15:55:11 -04:00
|
|
|
let!(:project) { create(:project, namespace: user.namespace) }
|
|
|
|
let!(:project2) { create(:project, namespace: user.namespace) }
|
2017-03-17 11:38:41 -04:00
|
|
|
|
|
|
|
before do
|
|
|
|
allow(Project).to receive(:default_per_page).and_return(1)
|
|
|
|
|
2017-06-21 19:44:10 -04:00
|
|
|
sign_in(user)
|
2017-03-17 11:38:41 -04:00
|
|
|
|
|
|
|
visit user_path(user)
|
|
|
|
|
|
|
|
page.within('.user-profile-nav') do
|
|
|
|
click_link('Personal projects')
|
|
|
|
end
|
|
|
|
|
2017-05-17 14:25:13 -04:00
|
|
|
wait_for_requests
|
2017-03-17 11:38:41 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'paginates results' do
|
|
|
|
expect(page).to have_content(project2.name)
|
|
|
|
|
|
|
|
click_link('Next')
|
|
|
|
|
|
|
|
expect(page).to have_content(project.name)
|
|
|
|
end
|
|
|
|
end
|