Sha256: cbd59ef3703438c0028406bd5620d3cbeee8d085ec28337e0419afcca33bd735

Contents?: true

Size: 602 Bytes

Versions: 6

Compression:

Stored size: 602 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

6 entries across 6 versions & 1 rubygems

Version Path
shoppe-0.0.10 test/models/shoppe/basket_test.rb
shoppe-0.0.9 test/models/shoppe/basket_test.rb
shoppe-0.0.8 test/models/shoppe/basket_test.rb
shoppe-0.0.7 test/models/shoppe/basket_test.rb
shoppe-0.0.6 test/models/shoppe/basket_test.rb
shoppe-0.0.5 test/models/shoppe/basket_test.rb