Files
fizzy/test/controllers/cards/collections_controller_test.rb
T
Jorge Manrubia 919211244b Review the code to move cards
- Scope accessed records
- Keep consistency by moving events too
2025-07-04 19:56:48 +02:00

21 lines
528 B
Ruby

require "test_helper"
class Cards::CollectionsControllerTest < ActionDispatch::IntegrationTest
setup do
sign_in_as :kevin
end
test "update changes card collection" do
card = cards(:logo)
new_collection = collections(:private)
assert_not_equal new_collection, card.collection
assert_changes -> { card.reload.collection }, from: card.collection, to: new_collection do
put card_collection_path(card), params: { collection_id: new_collection.id }
end
assert_redirected_to card
end
end