fix unit tests

This commit is contained in:
r888888888
2017-11-20 16:10:35 -08:00
parent f11992bd91
commit 502f1298a9
25 changed files with 101 additions and 29 deletions

View File

@@ -1,7 +1,9 @@
require 'test_helper'
class PostPrunerTest < ActiveSupport::TestCase
setup do
def setup
super
@user = FactoryGirl.create(:admin_user)
CurrentUser.user = @user
CurrentUser.ip_addr = "127.0.0.1"
@@ -21,7 +23,9 @@ class PostPrunerTest < ActiveSupport::TestCase
PostPruner.new.prune!
end
teardown do
def teardown
super
CurrentUser.user = nil
CurrentUser.ip_addr = nil
end