Sha256: 3bd652cf05b245fddf4c2af2a48a75a023160db818295e02269a4f3cf884c4b2
Contents?: true
Size: 755 Bytes
Versions: 16
Compression:
Stored size: 755 Bytes
Contents
require File.expand_path('../abstract_unit', __FILE__) class TestCounterCache < ActiveSupport::TestCase fixtures :dorms, :rooms, :tariffs def test_update_counter tariff = tariffs(:flat) assert_equal(50, tariff.amount) Tariff.update_counters(tariff.id, :amount => 1) tariff.reload assert_equal(51, tariff.amount) end def test_increment_counter tariff = tariffs(:flat) assert_equal(50, tariff.amount) Tariff.increment_counter(:amount, tariff.id) tariff.reload assert_equal(51, tariff.amount) end def test_decrement_counter tariff = tariffs(:flat) assert_equal(50, tariff.amount) Tariff.decrement_counter(:amount, tariff.id) tariff.reload assert_equal(49, tariff.amount) end end
Version data entries
16 entries across 16 versions & 1 rubygems