diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-04 15:08:40 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-04 15:08:40 +0000 |
commit | 6b833f1e0340e00fdee074da9c42c0d4e07a46d2 (patch) | |
tree | 6fc3a7a2f8a02fec8d1e7561b453d33eb4048dad /spec/services/users/update_service_spec.rb | |
parent | 88a0824944720b6edaaef56376713541b9a02118 (diff) | |
download | gitlab-ce-6b833f1e0340e00fdee074da9c42c0d4e07a46d2.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services/users/update_service_spec.rb')
-rw-r--r-- | spec/services/users/update_service_spec.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/services/users/update_service_spec.rb b/spec/services/users/update_service_spec.rb index 50bbb16e368..5cd6283ca96 100644 --- a/spec/services/users/update_service_spec.rb +++ b/spec/services/users/update_service_spec.rb @@ -55,6 +55,15 @@ describe Users::UpdateService do expect(result[:message]).to eq("Emoji is not included in the list") end + it 'ignores read-only attributes' do + allow(user).to receive(:read_only_attribute?).with(:name).and_return(true) + + expect do + update_user(user, name: 'changed' + user.name) + user.reload + end.not_to change { user.name } + end + def update_user(user, opts) described_class.new(user, opts.merge(user: user)).execute end |