saved searches: always show 'Saved searches' link in navbar.

* Always display 'Saved searches' link in subnav bar, even if the user
  hasn't created any saved searches yet.
* Eliminate use of `has_saved_searches` bitpref on users.
This commit is contained in:
evazion
2019-09-22 23:14:55 -05:00
parent 4e4c4d627e
commit a5949a4b28
5 changed files with 3 additions and 35 deletions

View File

@@ -146,11 +146,6 @@ class SavedSearchTest < ActiveSupport::TestCase
@saved_search = @user.saved_searches.create(query: " ZZZ xxx ")
end
should "update the bitpref on the user" do
@user.reload
assert(@user.has_saved_searches?, "should have saved_searches bitpref set")
end
should "normalize the query aside from the order" do
assert_equal("yyy xxx", @saved_search.query)
end
@@ -164,18 +159,6 @@ class SavedSearchTest < ActiveSupport::TestCase
end
end
context "Destroying a saved search" do
setup do
@saved_search = @user.saved_searches.create(query: "xxx")
@saved_search.destroy
end
should "update the bitpref on the user" do
@user.reload
assert(!@user.has_saved_searches?, "should not have the saved_searches bitpref set")
end
end
context "A user with max saved searches" do
setup do
@user = FactoryBot.create(:gold_user)