diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-16 12:08:46 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-16 12:08:46 +0300 |
commit | b806264d29b8d52ccb78a41dcc3d67f2b040700c (patch) | |
tree | af97e9d36b2c82520d6850836dee6ba8d7ed9b17 /spec/services/users | |
parent | 34ab9be97ecf84dd2b7a3b8f3149c0f7d1d7ab5c (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services/users')
-rw-r--r-- | spec/services/users/update_service_spec.rb | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/spec/services/users/update_service_spec.rb b/spec/services/users/update_service_spec.rb index f3c15011213..50bbb16e368 100644 --- a/spec/services/users/update_service_spec.rb +++ b/spec/services/users/update_service_spec.rb @@ -6,46 +6,6 @@ describe Users::UpdateService do let(:user) { create(:user) } describe '#execute' do - context 'updating name' do - context 'when the ability to update their name is not disabled for users' do - before do - stub_application_setting(updating_name_disabled_for_users: false) - end - - it 'updates the name' do - result = update_user(user, name: 'New Name') - - expect(result).to eq(status: :success) - expect(user.name).to eq('New Name') - end - end - - context 'when the ability to update their name is disabled for users' do - before do - stub_application_setting(updating_name_disabled_for_users: true) - end - - context 'executing as a regular user' do - it 'does not update the name' do - result = update_user(user, name: 'New Name') - - expect(result).to eq(status: :success) - expect(user.name).not_to eq('New Name') - end - end - - context 'executing as an admin user' do - it 'updates the name' do - admin = create(:admin) - result = described_class.new(admin, { user: user, name: 'New Name' }).execute - - expect(result).to eq(status: :success) - expect(user.name).to eq('New Name') - end - end - end - end - it 'updates time preferences' do result = update_user(user, timezone: 'Europe/Warsaw', time_display_relative: true, time_format_in_24h: false) |