Displaying 2 results from an estimated 2 matches for "test_add_unique_products".
2006 Jun 25
1
Unit Testing failure
...ts, 3 assertions, 1 failures, 0 errors
require File.dirname(__FILE__) + ''/../test_helper''
class CartTest < Test::Unit::TestCase
fixtures :products
def setup
@cart = Cart.new
@rails = products(:rails_book)
@ruby = products(:ruby_book)
end
def test_add_unique_products
@cart.add_product @rails
@cart.add_product @ruby
assert_equal 2, @cart.items.size
assert_equal @rails.price + @ruby.price, @cart.total_price
end
def test_add_duplicate_product
@cart.add_product @rails
@cart.add_product @ruby
assert_equal 2*@rails.price, @car...
2006 May 19
3
new to rails; problem with testing section in Agile book
...ting section and I can''t get past an error.
this is my cart_test.rb test file:
require File.dirname(__FILE__) + ''/../test_helper''
class CartTest < Test::Unit::TestCase
fixtures :products
def setup
@cart = Cart.new
end
# Replace this with 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...