This commit is contained in:
r888888888
2013-04-21 11:36:43 -07:00
parent 53c8babe3e
commit e2a38ebc17
11 changed files with 46 additions and 6 deletions

View File

@@ -15,6 +15,14 @@ class BanTest < ActiveSupport::TestCase
CurrentUser.ip_addr = nil
end
should "set the is_banned flag on the user" do
user = FactoryGirl.create(:user)
ban = FactoryGirl.build(:ban, :user => user, :banner => @banner)
ban.save
user.reload
assert(user.is_banned?)
end
should "not be valid against another admin" do
user = FactoryGirl.create(:admin_user)
ban = FactoryGirl.build(:ban, :user => user, :banner => @banner)