add test to ensure single anonymous user at unit user test

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7443 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-09-22 04:24:27 +00:00
parent 8280a0dbae
commit c36408dd39
1 changed files with 11 additions and 0 deletions

View File

@ -470,6 +470,17 @@ class UserTest < ActiveSupport::TestCase
assert_kind_of AnonymousUser, anon
end
def test_ensure_single_anonymous_user
AnonymousUser.delete_all
anon1 = User.anonymous
assert !anon1.new_record?
assert_kind_of AnonymousUser, anon1
anon1 = AnonymousUser.create(
:lastname => 'Anonymous', :firstname => '',
:mail => '', :login => '', :status => 0)
assert_equal 1, anon1.errors.count
end
should_have_one :rss_token
def test_rss_key