aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models/user_spec.rb
diff options
context:
space:
mode:
authorfrancis <francis>2008-03-15 04:19:03 +0000
committerfrancis <francis>2008-03-15 04:19:03 +0000
commit0a423eae84d6c2b123a50d2c7e8195a873aa224a (patch)
tree0b1a4e8832e63dbd7389bb9f5de5f94d518415f3 /spec/models/user_spec.rb
parentcb40d0436a2e19beaad0ec2715da97e9b8086527 (diff)
Add tests for broken case of saving info request or user when there is existing one with same title/name.
Fix the bug, which was in function that makes url_title/url_name.
Diffstat (limited to 'spec/models/user_spec.rb')
-rw-r--r--spec/models/user_spec.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index 11e906b6b..69295bf72 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -38,6 +38,7 @@ end
describe User, " when saving" do
before do
@user = User.new
+ @user2 = User.new
end
it "should not save without setting some parameters" do
@@ -64,5 +65,17 @@ describe User, " when saving" do
@user.email = "reasonable@localhost"
@user.save!
end
+
+ it "should let you make two users with same name" do
+ @user.name = "Mr. Flobble"
+ @user.password = "insecurepassword"
+ @user.email = "flobble@localhost"
+ @user.save!
+
+ @user2.name = "Mr. Flobble"
+ @user2.password = "insecurepassword"
+ @user2.email = "flobble2@localhost"
+ @user2.save!
+ end
end