Files
fizzy/test/models/command/search_test.rb
T
Jorge Manrubia 804a80dde6 Format
2025-05-06 15:18:41 +02:00

18 lines
649 B
Ruby

require "test_helper"
class Command::SearchTest < ActionDispatch::IntegrationTest
include CommandTestHelper
test "redirects 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 "respects 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