1 require File.dirname(__FILE__) + '/../test_helper'
3 class UserTest < Test::Unit::TestCase
6 def test_invalid_with_empty_attributes
9 assert user.errors.invalid?(:email)
10 assert user.errors.invalid?(:pass_crypt)
11 assert user.errors.invalid?(:display_name)
12 assert user.errors.invalid?(:email)
13 assert !user.errors.invalid?(:home_lat)
14 assert !user.errors.invalid?(:home_lon)
15 assert !user.errors.invalid?(:home_zoom)
19 new_user = User.new(:email => users(:normal_user).email,
21 :pass_crypt => Digest::MD5.hexdigest('test'),
22 :display_name => "new user",
24 :description => "desc")
26 assert_equal ActiveRecord::Errors.default_error_messages[:taken], new_user.errors.on(:email)