Welcome to mirror list, hosted at ThFree Co, Russian Federation.

preferences_spec.rb « profiles « features « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a946064a8772e0c9cb3ee0aac48c5866df1f1e96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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
    let(:default) { Gitlab::Themes.default }
    let(:theme)   { Gitlab::Themes.by_id(5) }

    before do
      visit profile_preferences_path
    end

    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

    it 'reflects the changes immediately' do
      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