test/test_helper.rb
# Expect the number of records in table to increase or decrease by change.
Expect the number of records in table to increase or decrease by change.
Expect the number of records in table to increase or decrease by change .
def assert_count_changed(table, change)
  cnt = DB[table].count
  yield
  new_cnt = DB[table].count
  assert_equal cnt + change, new_cnt, "Expected count for #{table} to change from #{cnt} to #{cnt + change} but count is now #{new_cnt}"
end
def assert_count_changed ( table , change ) cnt = DB [ table ] . count yield new_cnt = DB [ table ] . count assert_equal cnt + change , new_cnt , "Expected count for #{table} to change from #{cnt} to #{cnt + change} but count is now #{new_cnt}" end
Expect the number of records in table to increase or decrease by change.
Expect the number of records in table to increase or decrease by change .
table
<not_specific>
change
<not_specific>