fix tests

This commit is contained in:
Albert Yi
2018-06-05 16:08:45 -07:00
parent 856637ace4
commit 6c14d19010
2 changed files with 4 additions and 0 deletions

View File

@@ -23,6 +23,8 @@ class PopularSearchService
end
def fetch_data
return [] unless self.class.enabled?
dates = date.strftime("%Y-%m-%d")
Cache.get("ps-day-#{dates}", 1.minute) do

View File

@@ -3,6 +3,8 @@ require "test_helper"
class PostsControllerTest < ActionDispatch::IntegrationTest
context "The posts controller" do
setup do
PopularSearchService.stubs(:enabled?).returns(false)
@user = travel_to(1.month.ago) {create(:user)}
as_user do
@post = create(:post, :tag_string => "aaaa")