Files
fizzy/test/models/command/search_test.rb
T
Jorge Manrubia 863ced55c4 Add tests
2025-05-06 14:17:28 +02:00

18 lines
647 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