sort the default test database user and password.
authorShaun McDonald <shaun@shaunmcdonald.me.uk>
Mon, 2 Jun 2008 11:00:09 +0000 (11:00 +0000)
committerShaun McDonald <shaun@shaunmcdonald.me.uk>
Mon, 2 Jun 2008 11:00:09 +0000 (11:00 +0000)
Adding new test for the user

config/database.yml
test/unit/user_test.rb

index c0b5dd98c2bc707882f699322ce22f485c3d89d0..0fbfce31921013399d66573fc4a623836a71e3eb 100644 (file)
@@ -23,8 +23,8 @@ development:
 test:
   adapter: mysql
   database: osm_test
-  username: root
-  password:
+  username: osm_test
+  password: osm_test
   host: localhost
 
 production:
index 5468f7a2d90fc88f295f8beb1cfc595699bfce10..5f4c9525fec14cd7b19d8681a296f6bad46a6aa1 100644 (file)
@@ -7,4 +7,18 @@ class UserTest < Test::Unit::TestCase
   def test_truth
     assert true
   end
+  
+  def test_invalid_with_empty_attributes
+    user = User.new
+    assert !user.valid?
+    assert user.errors.invalid?(:email)
+    assert user.errors.invalid?(:pass_crypt)
+    assert user.errors.invalid?(:display_name)
+    assert user.errors.invalid?(:email)
+    assert !user.errors.invalid?(:home_lat)
+    assert !user.errors.invalid?(:home_lon)
+    assert !user.errors.invalid?(:home_zoom)
+  end
+  
+  
 end