Skip to content

Commit

Permalink
Test that payments are created
Browse files Browse the repository at this point in the history
The payment creation will be altered in an upcoming commit so I want the
current behaviour tested.
  • Loading branch information
AlistairNorman committed Jun 23, 2020
1 parent febe0e1 commit e02828f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions spec/requests/affirm_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@
end
let(:checkout_token) { "26VJRAAYE0MB0V25" }

it "creates a payment" do
expect {
post '/affirm/confirm', params: {
checkout_token: checkout_token,
payment_method_id: payment_method.id,
order_id: order.id,
use_route: :spree
}
}.to change { order.payments.count }.from(0).to(1)
end

it "redirect to the confirm page" do
VCR.use_cassette 'callback_hook_authorize_success' do
post '/affirm/confirm', params: {
Expand Down

0 comments on commit e02828f

Please sign in to comment.