add tests and fix some minor issues

This commit is contained in:
Manuel Araoz 2014-07-01 19:49:05 -03:00
commit 8b25b5932f
3 changed files with 29 additions and 6 deletions

View file

@ -300,7 +300,7 @@ describe("Unit: Controllers", function() {
'<form name="form">' +
'<input type="number" id="amount" name="amount" placeholder="Amount" ng-model="amount" min="0.0001" max="10000000" enough-amount required>' +
'</form>'
);
);
scope.model = {
amount: null
};
@ -368,4 +368,30 @@ describe("Unit: Controllers", function() {
});
});
describe('UriPayment Controller', function() {
var what;
beforeEach(inject(function($controller, $rootScope) {
scope = $rootScope.$new();
var routeParams = {
data: 'bitcoin:19mP9FKrXqL46Si58pHdhGKow88SUPy1V8%3Famount=1&message=a%20bitcoin%20donation'
};
what = $controller('UriPaymentController', {
$scope: scope,
$routeParams: routeParams
});
}));
it('should exist', function() {
should.exist(what);
});
it('should parse url correctly', function() {
should.exist(what);
scope.protocol.should.equal('bitcoin');
scope.address.should.equal('19mP9FKrXqL46Si58pHdhGKow88SUPy1V8');
scope.amount.should.equal(1);
scope.message.should.equal('a bitcoin donation');
});
});
});