diff options
| author | Vojta Jina | 2011-08-23 22:17:38 +0200 |
|---|---|---|
| committer | Igor Minar | 2011-11-30 11:17:22 -0500 |
| commit | 540701a8d8d843c61192f1105b210d870099cea8 (patch) | |
| tree | e77f53acd6fe33f04f1be5547cd63b8703e09fdc /test/angular-mocksSpec.js | |
| parent | 4d2d70e7fb7875f7e8dcaade59d7447725c61ceb (diff) | |
| download | angular.js-540701a8d8d843c61192f1105b210d870099cea8.tar.bz2 | |
feat(mocks.$browser): add simple addJs() method into $browser mock
Diffstat (limited to 'test/angular-mocksSpec.js')
| -rw-r--r-- | test/angular-mocksSpec.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/angular-mocksSpec.js b/test/angular-mocksSpec.js index 4551d11d..183c7d74 100644 --- a/test/angular-mocksSpec.js +++ b/test/angular-mocksSpec.js @@ -1,6 +1,32 @@ 'use strict'; describe('mocks', function() { + + describe('$browser', function() { + + describe('addJs', function() { + + it('should store url, id, done', inject(function($browser) { + var url = 'some.js', + id = 'js-id', + done = noop; + + $browser.addJs(url, id, done); + + var script = $browser.$$scripts.shift(); + expect(script.url).toBe(url); + expect(script.id).toBe(id); + expect(script.done).toBe(done); + })); + + + it('should return the script object', inject(function($browser) { + expect($browser.addJs('some.js', null, noop)).toBe($browser.$$scripts[0]); + })); + }); + }); + + describe('TzDate', function() { function minutes(min) { |
