Created
February 8, 2009 06:45
-
-
Save wanderingmatt/60276 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'test_helper' | |
class CartItemTest < ActiveSupport::TestCase | |
def test_initialize | |
cart_item = CartItem.new(products(:one)) | |
assert_equal 1, cart_item.quantity | |
end | |
def test_increment_quantity | |
cart_item = CartItem.new(products(:one)) | |
cart_item.increment_quantity | |
assert_equal 2, cart_item.quantity | |
end | |
def test_title | |
cart_item = CartItem.new(products(:one)) | |
assert_equal 'Pragmatic Project Automation', cart_item.title | |
end | |
def test_price | |
cart_item = CartItem.new(products(:one)) | |
assert_equal 29.00, cart_item.price.to_i | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment