in chapter 13
def test_100_orders Order.delete_all LineItem.delete_all
@controller.logger.silence do
elapsed_time = Benchmark.realtime do
100.downto(1) do |prd_id|
cart = Cart.new
cart.add_product(Product.find(prd_id))
post :save_order,
{ :order => DAVES_DETAILS },
{ :cart => cart }
assert_redirected_to :action => :index
end
end
assert_equal 100, Order.count
assert elapsed_time < 3.00
end
end
my question is : the test is ok, but after this test, my mysql depot_test’s orders table is empty and produtions table has 1000 records.
but in the test:assert_equal 100, Order.count is ok?
why?