fix tests
This commit is contained in:
@@ -23,6 +23,8 @@ class PopularSearchService
|
|||||||
end
|
end
|
||||||
|
|
||||||
def fetch_data
|
def fetch_data
|
||||||
|
return [] unless self.class.enabled?
|
||||||
|
|
||||||
dates = date.strftime("%Y-%m-%d")
|
dates = date.strftime("%Y-%m-%d")
|
||||||
|
|
||||||
Cache.get("ps-day-#{dates}", 1.minute) do
|
Cache.get("ps-day-#{dates}", 1.minute) do
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ require "test_helper"
|
|||||||
class PostsControllerTest < ActionDispatch::IntegrationTest
|
class PostsControllerTest < ActionDispatch::IntegrationTest
|
||||||
context "The posts controller" do
|
context "The posts controller" do
|
||||||
setup do
|
setup do
|
||||||
|
PopularSearchService.stubs(:enabled?).returns(false)
|
||||||
|
|
||||||
@user = travel_to(1.month.ago) {create(:user)}
|
@user = travel_to(1.month.ago) {create(:user)}
|
||||||
as_user do
|
as_user do
|
||||||
@post = create(:post, :tag_string => "aaaa")
|
@post = create(:post, :tag_string => "aaaa")
|
||||||
|
|||||||
Reference in New Issue
Block a user