Files
fizzy/test/controllers/recovers_controller_test.rb
T
2025-10-06 15:44:12 +02:00

20 lines
541 B
Ruby

require "test_helper"
class Cards::RecoversControllerTest < ActionDispatch::IntegrationTest
setup do
sign_in_as :jz
end
test "create" do
abandoned_card = collections(:writebook).cards.create! creator: users(:kevin)
travel_to 2.seconds.from_now
abandoned_card.update!(title: "An edited title")
unsaved_card = collections(:writebook).cards.create! creator: users(:kevin)
post card_recover_path(unsaved_card)
assert_redirected_to abandoned_card
assert_equal [ abandoned_card ], Card.creating
end
end