Remove unused command

This commit is contained in:
Jorge Manrubia
2025-05-16 14:20:20 +02:00
parent 5fe5419905
commit 3ccfc165b2
2 changed files with 0 additions and 28 deletions
-11
View File
@@ -1,11 +0,0 @@
class Command::Search < Command
store_accessor :data, :query, :params
def title
"Search '#{query}'"
end
def execute
redirect_to cards_path(**params.without("terms").merge(terms: Array.wrap(query.presence)))
end
end
-17
View File
@@ -1,17 +0,0 @@
require "test_helper"
class Command::SearchTest < ActionDispatch::IntegrationTest
include CommandTestHelper
test "redirect to the cards index filtering by search terms" do
result = execute_command "some text"
assert_equal cards_path(indexed_by: "newest", terms: [ "some text" ]), result.url
end
test "respect existing filters" do
result = execute_command "some text", context_url: "http://37signals.fizzy.localhost:3006/cards?collection_ids%5B%5D=#{collections(:writebook).id}"
assert_equal cards_path(indexed_by: "newest", collection_ids: [ collections(:writebook).id ], terms: [ "some text" ]), result.url
end
end