Files
fizzy/test/models/command/go_to_card_test.rb
T
2025-07-03 12:46:36 +02:00

27 lines
532 B
Ruby

require "test_helper"
class Command::GoToCardTest < ActionDispatch::IntegrationTest
include CommandTestHelper
include VcrTestHelper
setup do
@card = cards(:logo)
end
test "redirect to the card perma" do
result = execute_command "#{@card.id}"
assert_equal @card, result.url
end
test "result 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(terms: [ "123" ]), result.url
end
end