diff options
author | Ezekiel Kigbo <ekigbo@gitlab.com> | 2019-05-16 10:46:46 +0300 |
---|---|---|
committer | Ezekiel Kigbo <ekigbo@gitlab.com> | 2019-07-10 06:01:55 +0300 |
commit | 07652637bfdb15cce4d2355c6c116e6a0838e1d0 (patch) | |
tree | e1da20aca35d215f8d7aa3aa9eeb6f360efd903d | |
parent | 5071ff10e16752689e4f961003854e67917e997f (diff) |
Display timezone name not identifier
-rw-r--r-- | spec/features/profiles/user_edit_profile_spec.rb | 6 | ||||
-rw-r--r-- | spec/services/users/update_service_spec.rb | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/spec/features/profiles/user_edit_profile_spec.rb b/spec/features/profiles/user_edit_profile_spec.rb index a53da94ef7d..15b78eb6d23 100644 --- a/spec/features/profiles/user_edit_profile_spec.rb +++ b/spec/features/profiles/user_edit_profile_spec.rb @@ -341,17 +341,19 @@ describe 'User edit profile' do end it 'allows the user to select a time zone from a dropdown list of options' do + selected_tz = "Nuku'alofa" + expect(page.find('.user-time-preferences .dropdown')).not_to have_css('.show') page.find('.user-time-preferences .js-timezone-dropdown').click expect(page.find('.user-time-preferences .dropdown')).to have_css('.show') - page.find("a", text: "Nuku'alofa").click + page.find("a", text: selected_tz).click tz = page.find('.user-time-preferences #user_timezone', visible: false) - expect(tz.value).to eq('Pacific/Tongatapu') + expect(tz.value).to eq(selected_tz) end it 'timezone defaults to servers default' do diff --git a/spec/services/users/update_service_spec.rb b/spec/services/users/update_service_spec.rb index 9384287f98a..bdb154d8df3 100644 --- a/spec/services/users/update_service_spec.rb +++ b/spec/services/users/update_service_spec.rb @@ -14,10 +14,10 @@ describe Users::UpdateService do end it 'updates time preferences' do - result = update_user(user, timezone: 'Europe/Warsaw', time_display_relative: true, time_format_in_24h: false) + result = update_user(user, timezone: 'Warsaw', time_display_relative: true, time_format_in_24h: false) expect(result).to eq(status: :success) - expect(user.reload.timezone).to eq('Europe/Warsaw') + expect(user.reload.timezone).to eq('Warsaw') expect(user.time_display_relative).to eq(true) expect(user.time_format_in_24h).to eq(false) end |