diff --git a/app/models/command/search.rb b/app/models/command/search.rb deleted file mode 100644 index c25717790..000000000 --- a/app/models/command/search.rb +++ /dev/null @@ -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 diff --git a/test/models/command/search_test.rb b/test/models/command/search_test.rb deleted file mode 100644 index 7a394f8e3..000000000 --- a/test/models/command/search_test.rb +++ /dev/null @@ -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