paypro: fix mock server. unit controller tests.

This commit is contained in:
Christopher Jeffrey 2014-07-29 17:44:10 -07:00 committed by Manuel Araoz
commit 1c4d292a96
3 changed files with 35 additions and 7 deletions

View file

@ -10,6 +10,7 @@ saveAs = function(o) {
saveAsLastCall = o;
};
var startServer = require('../../mocks/FakePayProServer');
describe("Unit: Controllers", function() {
var invalidForm = {
@ -18,6 +19,8 @@ describe("Unit: Controllers", function() {
var scope;
var server;
beforeEach(module('copayApp.services'));
beforeEach(module('copayApp.controllers'));
@ -217,6 +220,15 @@ describe("Unit: Controllers", function() {
sinon.assert.callCount(scope.loadTxs, 1);
});
it('#start the example server', function(done) {
startServer(function(err, s) {
if (err) return done(err);
server = s;
server.uri = 'https://localhost:8080/-';
done();
});
});
it('should create a payment protocol transaction proposal', function() {
var uri = 'bitcoin:1JqniWpWNA6Yvdivg3y9izLidETnurxRQm?amount=0.00001000&r=https://localhost:8080/-/request';
sendForm.address.$setViewValue(uri);
@ -243,6 +255,12 @@ describe("Unit: Controllers", function() {
sinon.assert.callCount(spy, 1);
sinon.assert.callCount(spy2, 1);
});
it('#stop the example server', function(done) {
server.close(function() {
done();
});
});
});
describe("Unit: Version Controller", function() {