remove references to tag subscriptions
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
FactoryGirl.define do
|
||||
factory(:tag_subscription) do
|
||||
name {FFaker::Lorem.words.join(" ")}
|
||||
is_public true
|
||||
tag_query "aaa"
|
||||
end
|
||||
end
|
||||
@@ -1,39 +0,0 @@
|
||||
require 'test_helper'
|
||||
|
||||
class TagSubscriptionsControllerTest < ActionController::TestCase
|
||||
context "The tag subscriptions controller" do
|
||||
setup do
|
||||
@user = FactoryGirl.create(:user)
|
||||
CurrentUser.user = @user
|
||||
CurrentUser.ip_addr = "127.0.0.1"
|
||||
end
|
||||
|
||||
teardown do
|
||||
CurrentUser.user = nil
|
||||
CurrentUser.ip_addr = nil
|
||||
end
|
||||
|
||||
context "index action" do
|
||||
setup do
|
||||
@tag_subscription = FactoryGirl.create(:tag_subscription, :name => "aaa")
|
||||
end
|
||||
|
||||
should "list all visible tag subscriptions" do
|
||||
get :index
|
||||
assert_response :success
|
||||
end
|
||||
end
|
||||
|
||||
context "destroy action" do
|
||||
setup do
|
||||
@tag_subscription = FactoryGirl.create(:tag_subscription)
|
||||
end
|
||||
|
||||
should "destroy the posts" do
|
||||
assert_difference("TagSubscription.count", -1) do
|
||||
post :destroy, {:id => @tag_subscription.id}, {:user_id => @user.id}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,26 +0,0 @@
|
||||
require 'test_helper'
|
||||
|
||||
class TagSubscriptionTest < ActiveSupport::TestCase
|
||||
setup do
|
||||
user = FactoryGirl.create(:user)
|
||||
CurrentUser.user = user
|
||||
CurrentUser.ip_addr = "127.0.0.1"
|
||||
end
|
||||
|
||||
teardown do
|
||||
CurrentUser.user = nil
|
||||
CurrentUser.ip_addr = nil
|
||||
end
|
||||
|
||||
context "A tag subscription" do
|
||||
should "migrate to saved searches" do
|
||||
sub = FactoryGirl.create(:tag_subscription, tag_query: "foo bar\r\nbar\nbaz", :name => "Artist 1")
|
||||
sub.migrate_to_saved_searches
|
||||
|
||||
assert_equal(1, CurrentUser.user.subscriptions.size)
|
||||
assert_equal(3, CurrentUser.user.saved_searches.size)
|
||||
assert_equal(["foo bar", "bar", "baz"], CurrentUser.user.saved_searches.pluck(:query))
|
||||
assert_equal([%w[artist_1]]*3, CurrentUser.user.saved_searches.pluck(:labels))
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user