mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Test when a paypal stage produces an error
This commit is contained in:
parent
d21eb1b07f
commit
6bdfedc1b0
1 changed files with 20 additions and 1 deletions
|
@ -628,7 +628,7 @@ describe "RecurlyWrapper", ->
|
||||||
expect(sub).to.equal @subscription
|
expect(sub).to.equal @subscription
|
||||||
done()
|
done()
|
||||||
|
|
||||||
it 'should call each of the paypal functions', (done) ->
|
it 'should call each of the paypal stages', (done) ->
|
||||||
@call (err, sub) =>
|
@call (err, sub) =>
|
||||||
@checkAccountExists.callCount.should.equal 1
|
@checkAccountExists.callCount.should.equal 1
|
||||||
@createAccount.callCount.should.equal 1
|
@createAccount.callCount.should.equal 1
|
||||||
|
@ -636,3 +636,22 @@ describe "RecurlyWrapper", ->
|
||||||
@setAddress.callCount.should.equal 1
|
@setAddress.callCount.should.equal 1
|
||||||
@createSubscription.callCount.should.equal 1
|
@createSubscription.callCount.should.equal 1
|
||||||
done()
|
done()
|
||||||
|
|
||||||
|
describe 'when one of the paypal stages produces an error', ->
|
||||||
|
|
||||||
|
beforeEach ->
|
||||||
|
@createAccount.callsArgWith(1, new Error('woops'))
|
||||||
|
|
||||||
|
it 'should produce an error', (done) ->
|
||||||
|
@call (err, sub) =>
|
||||||
|
expect(err).to.be.instanceof Error
|
||||||
|
done()
|
||||||
|
|
||||||
|
it 'should stop calling the paypal stages after the error', (done) ->
|
||||||
|
@call (err, sub) =>
|
||||||
|
@checkAccountExists.callCount.should.equal 1
|
||||||
|
@createAccount.callCount.should.equal 1
|
||||||
|
@createBillingInfo.callCount.should.equal 0
|
||||||
|
@setAddress.callCount.should.equal 0
|
||||||
|
@createSubscription.callCount.should.equal 0
|
||||||
|
done()
|
||||||
|
|
Loading…
Reference in a new issue