diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/controllers/profiles/preferences_controller_spec.rb | 3 | ||||
-rw-r--r-- | spec/helpers/preferences_helper_spec.rb | 24 |
2 files changed, 26 insertions, 1 deletions
diff --git a/spec/controllers/profiles/preferences_controller_spec.rb b/spec/controllers/profiles/preferences_controller_spec.rb index 012f016b091..760c0fab130 100644 --- a/spec/controllers/profiles/preferences_controller_spec.rb +++ b/spec/controllers/profiles/preferences_controller_spec.rb @@ -42,7 +42,8 @@ describe Profiles::PreferencesController do prefs = { color_scheme_id: '1', dashboard: 'stars', - theme_id: '2' + theme_id: '2', + first_day_of_week: '1' }.with_indifferent_access expect(user).to receive(:assign_attributes).with(ActionController::Parameters.new(prefs).permit!) diff --git a/spec/helpers/preferences_helper_spec.rb b/spec/helpers/preferences_helper_spec.rb index c112c8ed633..4c395248644 100644 --- a/spec/helpers/preferences_helper_spec.rb +++ b/spec/helpers/preferences_helper_spec.rb @@ -35,6 +35,30 @@ describe PreferencesHelper do end end + describe '#first_day_of_week_choices' do + it 'returns Sunday and Monday as choices' do + expect(helper.first_day_of_week_choices).to eq [ + ['Sunday', 0], + ['Monday', 1] + ] + end + end + + describe '#first_day_of_week_choices_with_default' do + it 'returns choices including system default' do + expect(helper.first_day_of_week_choices_with_default).to eq [ + ['System default (Sunday)', nil], ['Sunday', 0], ['Monday', 1] + ] + end + + it 'returns choices including system default set to Monday' do + stub_application_setting(first_day_of_week: 1) + expect(helper.first_day_of_week_choices_with_default).to eq [ + ['System default (Monday)', nil], ['Sunday', 0], ['Monday', 1] + ] + end + end + describe '#user_application_theme' do context 'with a user' do it "returns user's theme's css_class" do |