Sha256: 8c6dc0f7767252b72dc0bb96604d14e4808d5e8a8fdd23cac7ddfe3541a5f158
Contents?: true
Size: 845 Bytes
Versions: 14
Compression:
Stored size: 845 Bytes
Contents
# Test cases devised by Santiago that broke the Composite Primary Keys # code at one point in time. But no more!!! require File.expand_path('../abstract_unit', __FILE__) class TestTouch < ActiveSupport::TestCase fixtures :products, :tariffs def test_touching_a_record_updates_its_timestamp tariff = tariffs(:flat) previous_amount = tariff.amount previously_updated_at = tariff.updated_at tariff.amount = previous_amount + 1 tariff.touch sleep 0.1 assert_not_equal previously_updated_at, tariff.updated_at assert_equal previous_amount + 1, tariff.amount assert tariff.amount_changed?, 'tarif amount should have changed' assert tariff.changed?, 'tarif should be marked as changed' tariff.reload assert_not_equal previously_updated_at, tariff.updated_at end end
Version data entries
14 entries across 14 versions & 1 rubygems