Sha256: 2c495973eff70993e4760c3a399ee978dacfe47795c8d079fabede574d1d5bd4
Contents?: true
Size: 785 Bytes
Versions: 20
Compression:
Stored size: 785 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
20 entries across 20 versions & 1 rubygems