Sha256: 0dda32cda8d2264d8a04b5f7e8830455cc40ab6d3b99523a0c2ed00ad104196b

Contents?: true

Size: 598 Bytes

Versions: 9

Compression:

Stored size: 598 Bytes

Contents

require 'test_helper'

module Shoppe
  class BasketTest < ActiveSupport::TestCase
    
    setup do
      @order = Order.create
    end
    
    test "initial status" do
      assert @order.building?
    end
    
    test "basket has no items by default" do
      assert_equal false, @order.has_items?
    end
    
    test "adding products" do
      @order.order_items.add_product(Product.find_by_sku('YL-SIP-T20P'))
      @order.order_items.add_product(Product.find_by_sku('YL-SIP-T22P'))
      assert_equal true, @order.has_items?
      assert_equal 2, @order.total_items
    end
    
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
shoppe-0.0.19 test/models/shoppe/basket_test.rb
shoppe-0.0.18 test/models/shoppe/basket_test.rb
shoppe-0.0.17 test/models/shoppe/basket_test.rb
shoppe-0.0.16 test/models/shoppe/basket_test.rb
shoppe-0.0.15 test/models/shoppe/basket_test.rb
shoppe-0.0.14 test/models/shoppe/basket_test.rb
shoppe-0.0.13 test/models/shoppe/basket_test.rb
shoppe-0.0.12 test/models/shoppe/basket_test.rb
shoppe-0.0.11 test/models/shoppe/basket_test.rb