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

24 lines
530 B
Ruby

require "test_helper"
class Command::GoToCardTest < ActionDispatch::IntegrationTest
include CommandTestHelper
setup do
@card = cards(:logo)
end
test "redirects to the card perma" do
result = execute_command "#{@card.id}"
assert_equal @card, result.url
end
test "results in a regular search if the card does not exist" do
command = parse_command "123"
assert command.valid?
result = command.execute
assert_equal cards_path(indexed_by: "newest", terms: [ "123" ]), result.url
end
end