# Unit tests with Authorize.net and ARB

**URL:** <https://www.ruby-forum.com/t/unit-tests-with-authorize-net-and-arb/123098>\
**Category:** Ruby\
**Created:** [December 14, 2007, 12:05am UTC](https://www.ruby-forum.com/t/unit-tests-with-authorize-net-and-arb/123098 "2007-12-14T00:05:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![janovetz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/53a042/32.png) [@janovetz](https://www.ruby-forum.com/u/janovetz)\
**Post date:** [December 14, 2007, 12:05am UTC](https://www.ruby-forum.com/t/unit-tests-with-authorize-net-and-arb/123098/1 "2007-12-14T00:05:56Z")

</div>

Hey folks–

I’m using [Authorize.net](http://Authorize.net) and their ARB (automatic recurring billing)  
feature. I’m trying to write unit tests for the interface to make sure  
that I can create/update/cancel subscriptions and also get proper errors  
back.

I have a developer’s test account, so I can run in “Test” and “Normal”  
mode without any ill effects.

In TEST mode, if I submit a valid create\_subscription call, I get an  
error:  
E00009: The payment gateway account is in Test mode. The request cannot  
be processed.

If I switch to NORMAL mode, and I submit a valid create\_subscription,  
this works just fine – the first time. Problem is, I want to do this  
sort of thing multiple times, as is the nature with unit tests.

Unfortunately, I then get the error:  
E00012: You have submitted a duplicate of Subscription 215771. A  
duplicate subscription will not be created.

I suppose I can ‘cancel’ any subscription that has been successfully  
created, but I’d prefer a better way to work this. Any suggestions?

I know this is more of an [Authorize.net](http://Authorize.net) question, but their developer  
support is pretty slow, so I thought I’d ask here for any experience  
from this camp.

Cheers,  
Jake
