mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
Fix old Spree specs
Given the importance of this code, it doesn't bring me much confidence. Apparently, this specs where using a non-existent state by mistake and this went unnoticed because the payment creation was failing silently in payment/processing.rb. This unearthed the fact that our `#ensure_correct_adjustment` needs the order to be persisted to succeed.
This commit is contained in:
@@ -2,11 +2,7 @@ require 'spec_helper'
|
||||
|
||||
describe Spree::Payment do
|
||||
context 'original specs from Spree' do
|
||||
let(:order) do
|
||||
order = Spree::Order.new(:bill_address => Spree::Address.new,
|
||||
:ship_address => Spree::Address.new)
|
||||
end
|
||||
|
||||
let(:order) { create(:order) }
|
||||
let(:gateway) do
|
||||
gateway = Spree::Gateway::Bogus.new(:environment => 'test', :active => true)
|
||||
gateway.stub :source_required => true
|
||||
@@ -339,7 +335,7 @@ describe Spree::Payment do
|
||||
|
||||
context "#credit" do
|
||||
before do
|
||||
payment.state = 'complete'
|
||||
payment.state = 'completed'
|
||||
payment.response_code = '123'
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user