fix tests

This commit is contained in:
albert
2013-03-25 23:58:44 -04:00
parent 5b1cb96fdd
commit f4cc6e7d99
3 changed files with 3 additions and 2 deletions

View File

@@ -667,7 +667,7 @@ class Post < ActiveRecord::Base
Cache.delete(Post.count_cache_key(tag_name))
end
if Post.fast_count("").to_i < 1000
if CurrentUser.user.id < 1_000
Cache.delete(Post.count_cache_key(""))
end
end

View File

@@ -357,6 +357,7 @@ class PostTest < ActiveSupport::TestCase
context "with an artist tag that is then changed to copyright" do
setup do
CurrentUser.user = FactoryGirl.create(:builder_user)
Delayed::Worker.delay_jobs = false
@post = Post.find(@post.id)
@post.update_attribute(:tag_string, "art:abc")

View File

@@ -2,7 +2,7 @@ require 'test_helper'
class TagTest < ActiveSupport::TestCase
setup do
user = FactoryGirl.create(:user)
user = FactoryGirl.create(:builder_user)
CurrentUser.user = user
CurrentUser.ip_addr = "127.0.0.1"
MEMCACHE.flush_all