Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 3bf7007

Browse files
author
Parth Shah
committedAug 13, 2015
adding spec
1 parent d556102 commit 3bf7007

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
 

‎app/services/helpers.service.spec.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/* jshint -W117, -W030 */
2+
describe('Helper Service', function() {
3+
4+
var service;
5+
6+
7+
beforeEach(function() {
8+
bard.appModule('tc.services', bard.fakeStateProvider);
9+
bard.inject(this, '$window', '$location', 'Helpers');
10+
11+
bard.mockService($window, {
12+
location: {
13+
href: "/"
14+
}
15+
});
16+
17+
service = Helpers;
18+
});
19+
20+
describe("Verify isEmail()", function() {
21+
it('should should return true for "test+12@appirio.com"', function() {
22+
expect(service.isEmail("test+12@appirio.com")).to.be(true);
23+
});
24+
25+
it('should should return false for "test123"', function() {
26+
expect(service.isEmail("test123")).to.be(false);
27+
});
28+
});
29+
30+
describe("Verify redirectPostLogin()", function() {
31+
it("should redirect to my-dashboard", function() {
32+
service.redirectPostLogin(encodeURIComponent("http://www.topcoder-dev.com"));
33+
expect($window.location.href).to.equal("http://www.topcoder-dev.com");
34+
});
35+
});
36+
37+
});

0 commit comments

Comments
 (0)
This repository has been archived.