search for: test_add_duplicate_product

Displaying 3 results from an estimated 3 matches for "test_add_duplicate_product".

2006 May 19
3
new to rails; problem with testing section in Agile book
...your real tests. def test_add_unique_products @cart.add_product products(:version_control_book) @cart.add_product products(:automation_book) assert_equal products(:version_control_book).price + products(:automation_book).price, @cart.total_price assert_equal 2, @cart.items.size end def test_add_duplicate_product @card.add_product products(:version_control_book) @card.add_product products(:version_control_book) assert_equal 2*products(:version_control_book).price, @cart.total_price assert_equal 1, @cart.items.size end end and I am getting this error: 1) Error: test_add_duplicate_product(CartTes...
2006 Jun 25
1
Unit Testing failure
When I run the unit testing code in Unit Testing Models chapter of the Agile Rails book, I get the following error: $ ruby test/unit/cart_test.rb Loaded suite test/unit/cart_test Started F. Finished in 0.21806 seconds. 1) Failure: test_add_duplicate_product(CartTest) [test/unit/cart_test.rb:22]: <4690> expected but was <3579>. 2 tests, 3 assertions, 1 failures, 0 errors require File.dirname(__FILE__) + ''/../test_helper'' class CartTest < Test::Unit::TestCase fixtures :products def setup @cart = Cart.n...
2006 Jun 24
1
@version_control_book not available while testing - AWD book 1 page 148
In the page 148 of the AWD book it''s mentioned that the while testing @products and @version_control_book are automatically made available. That''s not the case with me. In my test environment I don''t get those two variables. I was wondering if anything has changed in Rails 1.1 because in the new edition of the book (AWD - edition 2) there is no mention of such