aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models/user_spec.rb
diff options
context:
space:
mode:
authortony <tony>2009-03-22 15:13:07 +0000
committertony <tony>2009-03-22 15:13:07 +0000
commitaadc737376291f5bf2fbc4368de5275b19f21885 (patch)
treec03fddd14961db69353bb0dead0ef780c636fbee /spec/models/user_spec.rb
parent7159467776e94e4a5e4818cd43bf85052d0da3a8 (diff)
Test for specific errors in User
Diffstat (limited to 'spec/models/user_spec.rb')
-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