Slide 44
Slide 44 text
it 'does not pay an inactive order' do
customer = Customer.create!(name: 'John')
seller = Seller.create!(name: 'JewelStore')
product = Product.create!(name: 'Ruby', seller: seller, price_unit: 2015)
credit_card = PaymentMethod.create!(name: 'Visa', type: 'credit card')
order = Order.create!(
customer: customer,
seller: seller,
product: product,
status: :inactive
)
payment = order.pay!(credit_card)
expect(payment).to be(false)
order.destroy!
product.destroy!
credit_card.destroy!
seller.destroy!
customer.destroy!
end