gitlab-org--gitlab-foss/spec/features/profiles/preferences_spec.rb

60 lines
1.5 KiB
Ruby
Raw Normal View History

require 'spec_helper'
describe 'Profile > Preferences', feature: true do
let(:user) { create(:user) }
before do
login_as(user)
visit profile_preferences_path
end
describe 'User changes their syntax highlighting theme', js: true do
it 'creates a flash message' do
choose 'user_color_scheme_id_5'
expect_preferences_saved_message
end
it 'updates their preference' do
choose 'user_color_scheme_id_5'
allowing_for_delay do
visit page.current_path
expect(page).to have_checked_field('user_color_scheme_id_5')
end
end
end
2016-06-10 16:08:13 -04:00
describe 'User changes their default dashboard', js: true do
it 'creates a flash message' do
select 'Starred Projects', from: 'user_dashboard'
click_button 'Save'
expect_preferences_saved_message
end
it 'updates their preference' do
select 'Starred Projects', from: 'user_dashboard'
click_button 'Save'
2016-06-10 16:08:13 -04:00
allowing_for_delay do
find('#logo').click
2016-08-11 12:48:32 -04:00
expect(page).to have_content("You don't have starred projects yet")
2016-06-10 16:08:13 -04:00
expect(page.current_path).to eq starred_dashboard_projects_path
end
click_link 'Your projects'
2016-08-11 12:48:32 -04:00
expect(page).not_to have_content("You don't have starred projects yet")
2015-09-08 12:14:02 -04:00
expect(page.current_path).to eq dashboard_projects_path
end
end
def expect_preferences_saved_message
2015-06-18 22:13:32 -04:00
page.within('.flash-container') do
expect(page).to have_content('Preferences saved.')
end
end
end