Sha256: f7c913abdca14173eb6a7b8757820bda05afe1ac23a21c5e4cb7ef54a6c66a80
Contents?: true
Size: 1.23 KB
Versions: 1
Compression:
Stored size: 1.23 KB
Contents
require_relative 'test_helper' class PurchaseOrderTest < Skr::TestCase def test_creation po = PurchaseOrder.new({ terms: skr_payment_terms(:cred_card), vendor: skr_vendors(:bigco), location: skr_locations(:default) }) po.lines.build({ sku_loc: skr_sku_locs(:hatdefault), description: 'a test item', uom_code: 'BX', uom_size: 10, price: 33.3 }) assert_saves po end def test_state_transistions po = skr_purchase_orders(:first) assert_equal 'open', po.state assert_equal [ :mark_received ], po.valid_state_events po.mark_received! assert_equal 'received', po.state assert_empty po.valid_state_events assert_saves po end def test_receiving po = skr_purchase_orders(:first) por = PoReceipt.new( purchase_order: po ) po.lines.each do | pol| next if pol.qty_unreceived.zero? por.lines.build({ :po_line => pol }) end assert_saves por assert_equal 'received', po.state end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
stockor-core-0.2 | test/purchase_order_test.rb |