Files
fizzy/test/models/collection/cards_test.rb
T
David Heinemeier Hansson 966aa51a37 Get rid of unnecessary touch jobs
touch_all on 10K cards took 6ms in testing
2025-11-02 14:15:53 +01:00

16 lines
418 B
Ruby

require "test_helper"
class Collection::CardsTest < ActiveSupport::TestCase
test "touch cards when the name changes" do
collection = collections(:writebook)
assert_changes -> { collection.cards.first.updated_at } do
collection.update!(name: "New Name")
end
assert_no_changes -> { collection.cards.first.updated_at } do
collection.update!(updated_at: 1.hour.from_now)
end
end
end