fix tests

This commit is contained in:
Matias Alejo Garcia 2016-06-02 14:56:19 -03:00
commit e0a43bd90d
No known key found for this signature in database
GPG key ID: 02470DB551277AB3

View file

@ -85,18 +85,19 @@ mocks.init = function(fixtures, controllerName, opts, done) {
module('bwcModule', function($provide) { module('bwcModule', function($provide) {
$provide.decorator('bwcService', function($delegate, lodash) { $provide.decorator('bwcService', function($delegate, lodash) {
var getClient = $delegate.getClient; var getClient = $delegate.getClient;
var config = $delegate.config;
// Fix Encryption IVs // Fix Encryption IVs
var utils = $delegate.getUtils(); var utils = $delegate.getUtils();
utils.SJCL.iv = 'BZQVWAP6d1e4G8Fq1rQKbA=='; utils.SJCL.iv = 'BZQVWAP6d1e4G8Fq1rQKbA==';
$delegate.getClient = function(walletData) { $delegate.getClient = function(walletData, opts) {
var bwc = new $delegate.Client(); var bwc = new $delegate.Client();
if (walletData) if (walletData)
bwc.import(walletData, { bwc.import(walletData, {
baseUrl: config.baseUrl baseUrl: opts.baseurl || 'https://bws.bitpay.com/bws/api',
verbose: opts.verbose,
transports: ['polling'],
}); });
function createHash(method, url, args) { function createHash(method, url, args) {