separated out ip ban logic from regular bans, users can no longer register if an ip ban is in place

This commit is contained in:
albert
2010-03-18 17:55:57 -04:00
parent dcf8d0df4c
commit e46bfb3d76
12 changed files with 124 additions and 33 deletions

View File

@@ -153,18 +153,6 @@ class BanTest < ActiveSupport::TestCase
ban = Factory.create(:ban, :user => user, :banner => admin, :duration => 1)
assert(Ban.is_user_banned?(user))
end
end
context "by ip address" do
should "not return expired bans" do
admin = Factory.create(:admin_user)
ban = Factory.create(:ban, :ip_addr => "1.2.3.4", :banner => admin, :duration => -1)
assert(!Ban.is_ip_banned?("1.2.3.4"))
ban = Factory.create(:ban, :ip_addr => "5.6.7.8", :banner => admin, :duration => 1)
assert(Ban.is_ip_banned?("5.6.7.8"))
end
end
end
end
end