Skip to content

Instantly share code, notes, and snippets.

@bmishkin
Created September 29, 2011 16:04
Show Gist options
  • Save bmishkin/1251100 to your computer and use it in GitHub Desktop.
Save bmishkin/1251100 to your computer and use it in GitHub Desktop.
failing rspecs
1) IncomingPayment callbacks accounting transaction should include 8 postings if the payment contains both late and early orders
Failure/Error: expect { @ip.save! }.to change(@ip.account_postings, :count).by(8)
Validation failed: Account postings amount must be greater than or equal to 0
# ./app/models/incoming_payment.rb:108:in `create_transaction'
# ./spec/models/incoming_payment_spec.rb:99:in `block (5 levels) in <top (required)>'
# ./spec/models/incoming_payment_spec.rb:99:in `block (4 levels) in <top (required)>'
/usr/local/bin/gs -dNOPAUSE -dBATCH -dQUIET -dNOPAGEPROMPT -I/Users/bmishkin/.rvm/gems/ruby-1.9.2-p136@rails3-countrystone-erp/gems/rghost-0.8.7.5/lib/rghost/ps -I/Users/bmishkin/.rvm/gems/ruby-1.9.2-p136@rails3-countrystone-erp/gems/rghost_barcode-0.8/lib/rghost_barcode/ps -sDEVICE=pdfwrite -sstdout=/tmp/checks_09-29-2011.pdf.rgerr -sOutputFile=/tmp/checks_09-29-2011.pdf -dDEVICEWIDTHPOINTS=842 -dDEVICEHEIGHTPOINTS=597 /tmp/checks_09-29-2011.pdf.rgin
2) PurchaseOrder callback methods should set the purchase order's total_price (net_cost + freight + tax) before validation
Failure/Error: po.save!
NaN
# ./app/models/purchase_order_item.rb:93:in `freight_cost'
# ./app/models/purchase_order_item.rb:103:in `net_cost'
# ./app/models/purchase_order.rb:452:in `block in subtotal'
# ./app/models/purchase_order.rb:452:in `subtotal'
# ./app/models/purchase_order.rb:315:in `set_total_price'
# ./spec/models/purchase_order_spec.rb:119:in `block (3 levels) in <top (required)>'
3) PurchaseOrder instance methods .received should process reference_po send straight to payment
Failure/Error: expect { po.receive }.to change(po.reference_po, :state)
state should have changed, but is still "open"
# ./spec/models/purchase_order_spec.rb:282:in `block (3 levels) in <top (required)>'
4) PurchaseOrder state machine should update received at when transitioning to straight to payment
Failure/Error: po.straight_to_payment!
Cannot transition state via :straight_to_payment from :open
# ./spec/models/purchase_order_spec.rb:368:in `block (3 levels) in <top (required)>'
5) SalesOrder instance methods state transitions .invoiced should process reference_po send straight to payment
Failure/Error: expect { so.approve_ship_ticket }.to change(so.reference_po, :state)
state should have changed, but is still "open"
# ./spec/models/sales_order_spec.rb:461:in `block (4 levels) in <top (required)>'
6) SalesOrder class methods #good_orders should only return orders within the weight AND pallet range
Failure/Error: SalesOrder.good_orders.collect { |so| so.id }.should =~ [good.id, good2.id]
expected collection contained: [8143, 8144]
actual collection contained: []
the missing elements were: [8143, 8144]
# ./spec/models/sales_order_spec.rb:756:in `block (3 levels) in <top (required)>'
1046/1046: 100% |==========================================| Time: 00:02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment