Showing
1 changed file
with
16 additions
and
0 deletions
| ... | @@ -2,7 +2,23 @@ | ... | @@ -2,7 +2,23 @@ |
| 2 | require 'spec_helper' | 2 | require 'spec_helper' |
| 3 | 3 | ||
| 4 | describe Var::ConektaHandler do | 4 | describe Var::ConektaHandler do |
| 5 | + let!(:product) { | ||
| 6 | + # product = instance_double('Product') | ||
| 7 | + # allow(product).to receive(:charge_with).and_return(:success) | ||
| 8 | + # product | ||
| 9 | + Product.create | ||
| 10 | + } | ||
| 11 | + | ||
| 12 | + let!(:var_mock) { | ||
| 13 | + var = class_double('Var') | ||
| 14 | + allow(var).to receive(:find_charge).and_return(product) | ||
| 15 | + var | ||
| 16 | + } | ||
| 17 | + | ||
| 5 | it 'processes oxxo payment' do | 18 | it 'processes oxxo payment' do |
| 19 | + Var::ConektaHandler.analyze(WebHookPostRequest::OXXO_CHARGE_CREATED) | ||
| 20 | + expect(product.var_status).to eq('paid') | ||
| 21 | + | ||
| 6 | end | 22 | end |
| 7 | 23 | ||
| 8 | it 'processes card payment' do | 24 | it 'processes card payment' do | ... | ... |
-
Please register or login to post a comment