2016-09-02 07:29:05 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'Snippets tab on a user profile', feature: true, js: true do
|
|
|
|
include WaitForAjax
|
|
|
|
|
|
|
|
context 'when the user has snippets' do
|
2016-09-23 13:28:14 -04:00
|
|
|
let(:user) { create(:user) }
|
|
|
|
let!(:snippets) { create_list(:snippet, 2, :public, author: user) }
|
2016-09-02 07:29:05 -04:00
|
|
|
before do
|
2016-09-23 13:28:14 -04:00
|
|
|
allow(Snippet).to receive(:default_per_page).and_return(1)
|
2016-09-02 07:29:05 -04:00
|
|
|
visit user_path(user)
|
|
|
|
page.within('.user-profile-nav') { click_link 'Snippets' }
|
|
|
|
wait_for_ajax
|
|
|
|
end
|
|
|
|
|
2016-09-23 13:28:14 -04:00
|
|
|
it_behaves_like 'paginated snippets', remote: true
|
2016-09-02 07:29:05 -04:00
|
|
|
end
|
|
|
|
end
|