spec/lib/order_spec.rb in trebbianno-ruby-api-0.0.6 vs spec/lib/order_spec.rb in trebbianno-ruby-api-0.0.7

- old
+ new

@@ -37,15 +37,23 @@ expect(charge).to eq 30 end end describe 'private#line_item_discount' do - let(:discount) {[13.33, 26.67]} + let(:discount) {[10, 20]} it 'should calculate discount price for line item' do order_hash[:line_items].each_with_index do |item, index| discount_amount = order_client.send(:line_item_discount, item[:price], order_hash) expect(discount_amount).to eq discount[index] end + end + end + + describe 'private#line_item_total' do + let(:total) {400} + it 'should calculate total price for line items' do + total_amount = order_client.send(:line_item_total, order_hash) + expect(total_amount).to eq total end end end