summaryrefslogtreecommitdiff
path: root/spec/helpers
diff options
context:
space:
mode:
authorhaghighi_ahmad <haghighi.ahmad@gmail.com>2019-02-24 09:12:22 +0330
committerhaghighi_ahmad <haghighi.ahmad@gmail.com>2019-03-04 07:52:15 +0330
commitcf4bbd4fe18222234e21c9bc4a12ea195a4bd11d (patch)
tree81d5a4a79efc4711d03251f9445b0fcf7b5e32c8 /spec/helpers
parent7f3a103006d941cac14fec37ab6159de7055fde7 (diff)
downloadgitlab-ce-cf4bbd4fe18222234e21c9bc4a12ea195a4bd11d.tar.gz
Add Saturday to first day of the week
fix #58023 docs for adding Saturday for first day of the week add related settings for Saturday as first day of the week firstDayOfWeek: Use enumeration, replace day's numbers with corresponding names make some variables lowercase (follow camelCase) add CHANGELOG entry Author: haghighi_ahmad <haghighi.ahmad@gmail.com> modified: app/assets/javascripts/pages/users/activity_calendar.js modified: app/helpers/preferences_helper.rb new file: changelogs/unreleased/58023-add-Saturday-to-localization-first-day-of-the-week.yml modified: doc/api/settings.md modified: doc/user/profile/preferences.md modified: locale/gitlab.pot modified: spec/helpers/preferences_helper_spec.rb
Diffstat (limited to 'spec/helpers')
-rw-r--r--spec/helpers/preferences_helper_spec.rb16
1 files changed, 12 insertions, 4 deletions
diff --git a/spec/helpers/preferences_helper_spec.rb b/spec/helpers/preferences_helper_spec.rb
index e0e8ebd0c3c..db0d45c3692 100644
--- a/spec/helpers/preferences_helper_spec.rb
+++ b/spec/helpers/preferences_helper_spec.rb
@@ -36,10 +36,11 @@ describe PreferencesHelper do
end
describe '#first_day_of_week_choices' do
- it 'returns Sunday and Monday as choices' do
+ it 'returns Saturday, Sunday and Monday as choices' do
expect(helper.first_day_of_week_choices).to eq [
['Sunday', 0],
- ['Monday', 1]
+ ['Monday', 1],
+ ['Saturday', 6]
]
end
end
@@ -47,14 +48,21 @@ describe PreferencesHelper do
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]
+ ['System default (Sunday)', nil], ['Sunday', 0], ['Monday', 1], ['Saturday', 6]
]
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]
+ ['System default (Monday)', nil], ['Sunday', 0], ['Monday', 1], ['Saturday', 6]
+ ]
+ end
+
+ it 'returns choices including system default set to Saturday' do
+ stub_application_setting(first_day_of_week: 6)
+ expect(helper.first_day_of_week_choices_with_default).to eq [
+ ['System default (Saturday)', nil], ['Sunday', 0], ['Monday', 1], ['Saturday', 6]
]
end
end