2017-02-16 17:02:40 -05:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'User Callouts', js: true do
|
|
|
|
let(:user) { create(:user) }
|
|
|
|
let(:project) { create(:empty_project, path: 'gitlab', name: 'sample') }
|
|
|
|
|
|
|
|
before do
|
|
|
|
login_as(user)
|
|
|
|
project.team << [user, :master]
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'takes you to the profile preferences when the link is clicked' do
|
|
|
|
visit dashboard_projects_path
|
|
|
|
click_link 'Check it out'
|
|
|
|
expect(current_path).to eq profile_preferences_path
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'user callout should appear in two routes' do
|
|
|
|
it 'shows up on the user profile' do
|
|
|
|
visit user_path(user)
|
2017-02-17 12:28:52 -05:00
|
|
|
expect(find('.user-callout')).to have_content 'Customize your experience'
|
2017-02-16 17:02:40 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'shows up on the dashboard projects' do
|
|
|
|
visit dashboard_projects_path
|
2017-02-17 12:28:52 -05:00
|
|
|
expect(find('.user-callout')).to have_content 'Customize your experience'
|
2017-02-16 17:02:40 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'hides the user callout when click on the dismiss icon' do
|
|
|
|
visit user_path(user)
|
2017-02-17 12:28:52 -05:00
|
|
|
within('.user-callout') do
|
2017-02-20 10:39:23 -05:00
|
|
|
find('.close-user-callout').click
|
2017-02-16 17:02:40 -05:00
|
|
|
end
|
|
|
|
expect(page).not_to have_selector('#user-callout')
|
|
|
|
end
|
2017-02-16 18:45:05 -05:00
|
|
|
end
|