* Missing files

* Work on post exploration code by traversing dates
This commit is contained in:
albert
2010-10-27 20:16:43 -04:00
parent f9cdcef2c0
commit fc0a076aca
32 changed files with 371 additions and 189 deletions

View File

@@ -2,8 +2,8 @@ require_relative '../test_helper'
class IpBanTest < ActiveSupport::TestCase
setup do
user = Factory.create(:user)
CurrentUser.user = user
@user = Factory.create(:user)
CurrentUser.user = @user
CurrentUser.ip_addr = "127.0.0.1"
MEMCACHE.flush_all
end
@@ -20,8 +20,10 @@ class IpBanTest < ActiveSupport::TestCase
end
should "be able to count any updates from a user, groupiny by IP address" do
comment = Factory.create(:comment, :ip_addr => "1.2.3.4", :body => "aaa")
counts = IpBan.search([comment.creator_id])
assert_equal([{"ip_addr" => "1.2.3.4", "count" => "1"}], counts["comments"])
CurrentUser.scoped(@user, "1.2.3.4") do
comment = Factory.create(:comment, :body => "aaa")
counts = IpBan.search([comment.creator_id])
assert_equal([{"ip_addr" => "1.2.3.4", "count" => "1"}], counts["comments"])
end
end
end