diff options
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/user_spec.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index c4bf9ebf25e..9a9e255f874 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -2063,10 +2063,15 @@ describe User do context 'when there is a validation error (namespace name taken) while updating namespace' do let!(:conflicting_namespace) { create(:group, name: new_username, path: 'quz') } - it "causes the user save to fail" do + it 'causes the user save to fail' do expect(user.update_attributes(username: new_username)).to be_falsey expect(user.namespace.errors.messages[:name].first).to eq('has already been taken') end + + it 'adds the namespace errors to the user' do + user.update_attributes(username: new_username) + expect(user.errors.full_messages.first).to eq('Namespace name has already been taken') + end end end |