saved searches: remove option to disable saved searches.

Remove `SavedSearch.enabled?` checks. There's no need to make saved
searches optional, since Redis is now required to run Danbooru.
This commit is contained in:
evazion
2019-09-22 23:04:22 -05:00
parent c33c33500e
commit 4e4c4d627e
11 changed files with 19 additions and 48 deletions

View File

@@ -3,7 +3,6 @@ require 'test_helper'
class SavedSearchesControllerTest < ActionDispatch::IntegrationTest
context "The saved searches controller" do
setup do
SavedSearch.stubs(:enabled?).returns(true)
@user = create(:user)
as_user do
@saved_search = create(:saved_search, user: @user)

View File

@@ -61,7 +61,6 @@ class ActiveSupport::TestCase
include ReportbooruHelper
include DownloadTestHelper
include IqdbTestHelper
include SavedSearchTestHelper
include UploadTestHelper
include TestHelpers

View File

@@ -1,5 +0,0 @@
module SavedSearchTestHelper
def mock_saved_search_service!
SavedSearch.stubs(:enabled?).returns(true)
end
end

View File

@@ -2256,7 +2256,6 @@ class PostTest < ActiveSupport::TestCase
context "saved searches" do
setup do
SavedSearch.stubs(:enabled?).returns(true)
@post1 = FactoryBot.create(:post, tag_string: "aaa")
@post2 = FactoryBot.create(:post, tag_string: "bbb")
FactoryBot.create(:saved_search, query: "aaa", labels: ["zzz"], user: CurrentUser.user)

View File

@@ -126,10 +126,6 @@ class TagAliasTest < ActiveSupport::TestCase
end
context "saved searches" do
setup do
SavedSearch.stubs(:enabled?).returns(true)
end
should "move saved searches" do
tag1 = FactoryBot.create(:tag, :name => "...")
tag2 = FactoryBot.create(:tag, :name => "bbb")