966aa51a37
touch_all on 10K cards took 6ms in testing
16 lines
418 B
Ruby
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
|