aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--spec/models/user_spec.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index 52ec6e819..d4fdba67c 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -48,21 +48,21 @@ describe User, " when saving" do
@user.name = "Mr. Silly"
@user.password = "insecurepassword"
@user.email = "mousefooble"
- lambda { @user.save! }.should raise_error(ActiveRecord::RecordInvalid)
+ @user.should have(1).error_on(:email)
end
it "should not allow an email address as a name" do
@user.name = "silly@example.com"
@user.email = "silly@example.com"
@user.password = "insecurepassword"
- lambda { @user.save! }.should raise_error(ActiveRecord::RecordInvalid)
+ @user.should have(1).error_on(:name)
end
it "should not save with no password" do
@user.name = "Mr. Silly"
@user.password = ""
@user.email = "silly@localhost"
- lambda { @user.save! }.should raise_error(ActiveRecord::RecordInvalid)
+ @user.should have(1).error_on(:hashed_password)
end
it "should save with reasonable name, password and email" do