2015-06-05 17:57:01 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'Profile > Preferences' do
|
|
|
|
let(:user) { create(:user) }
|
|
|
|
|
|
|
|
before do
|
|
|
|
login_as(user)
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'User changes their application theme', js: true do
|
2015-06-05 19:50:36 +00:00
|
|
|
let(:default) { Gitlab::Themes.default }
|
|
|
|
let(:theme) { Gitlab::Themes.by_id(5) }
|
2015-06-05 17:57:01 +00:00
|
|
|
|
|
|
|
before do
|
|
|
|
visit profile_preferences_path
|
|
|
|
end
|
|
|
|
|
2015-06-05 22:01:45 +00:00
|
|
|
it 'creates a flash message' do
|
|
|
|
choose "user_theme_id_#{theme.id}"
|
|
|
|
|
|
|
|
within('.flash-container') do
|
|
|
|
expect(page).to have_content('Preferences saved.')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2015-06-05 19:50:36 +00:00
|
|
|
it 'reflects the changes immediately' do
|
2015-06-05 17:57:01 +00:00
|
|
|
expect(page).to have_selector("body.#{default.css_class}")
|
|
|
|
|
|
|
|
choose "user_theme_id_#{theme.id}"
|
|
|
|
|
|
|
|
expect(page).not_to have_selector("body.#{default.css_class}")
|
|
|
|
expect(page).to have_selector("body.#{theme.css_class}")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'User changes their syntax highlighting theme' do
|
|
|
|
before do
|
|
|
|
visit profile_preferences_path
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|