summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorClement Ho <clemmakesapps@gmail.com>2019-03-06 11:54:57 +0000
committerClement Ho <clemmakesapps@gmail.com>2019-03-06 11:54:57 +0000
commit36051b9a2b0d3b46a5efc65acecd3b2ba9ac9b2f (patch)
tree8fafb44241415fdc5e7b165d684556c9bbb7bcdb /spec
parentc32dccfd5f7f54633c25652044a9b060673415be (diff)
parentcf4bbd4fe18222234e21c9bc4a12ea195a4bd11d (diff)
downloadgitlab-ce-36051b9a2b0d3b46a5efc65acecd3b2ba9ac9b2f.tar.gz
Merge branch '58023-add-Saturday-to-localization-first-day-of-the-week' into 'master'
Resolve "Add Saturday to Localization first day of the week" Closes #58023 See merge request gitlab-org/gitlab-ce!25509
Diffstat (limited to 'spec')
-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