summaryrefslogtreecommitdiff
path: root/spec/controllers/admin/users_controller_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/controllers/admin/users_controller_spec.rb')
-rw-r--r--spec/controllers/admin/users_controller_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/controllers/admin/users_controller_spec.rb b/spec/controllers/admin/users_controller_spec.rb
index 33fe3c73822..2ab2ca1b667 100644
--- a/spec/controllers/admin/users_controller_spec.rb
+++ b/spec/controllers/admin/users_controller_spec.rb
@@ -114,6 +114,17 @@ describe Admin::UsersController do
end
end
+ describe 'POST create' do
+ it 'creates the user' do
+ expect{ post :create, user: attributes_for(:user) }.to change{ User.count }.by(1)
+ end
+
+ it 'shows only one error message for an invalid email' do
+ post :create, user: attributes_for(:user, email: 'bogus')
+ expect(assigns[:user].errors).to contain_exactly("Email is invalid")
+ end
+ end
+
describe 'POST update' do
context 'when the password has changed' do
def update_password(user, password, password_confirmation = nil)