Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-04 18:08:40 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-04 18:08:40 +0300
commit6b833f1e0340e00fdee074da9c42c0d4e07a46d2 (patch)
tree6fc3a7a2f8a02fec8d1e7561b453d33eb4048dad /spec/services
parent88a0824944720b6edaaef56376713541b9a02118 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services')
-rw-r--r--spec/services/users/update_service_spec.rb9
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