summaryrefslogtreecommitdiffstats
path: root/test/unit/user_test.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-09-22 04:24:27 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-09-22 04:24:27 +0000
commitc36408dd390900d4d0a2ed6160d4c44852197c72 (patch)
tree73945e4ac53c6c462fa95153888309d51aac9350 /test/unit/user_test.rb
parent8280a0dbaeb98cd4c4ca85374c3b1047430d1e0a (diff)
downloadredmine-c36408dd390900d4d0a2ed6160d4c44852197c72.tar.gz
redmine-c36408dd390900d4d0a2ed6160d4c44852197c72.zip
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
Diffstat (limited to 'test/unit/user_test.rb')
-rw-r--r--test/unit/user_test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/unit/user_test.rb b/test/unit/user_test.rb
index 9a3ca6bc3..590e1d282 100644
--- a/test/unit/user_test.rb
+++ b/test/unit/user_test.rb
@@ -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