diff options
Diffstat (limited to 'test/ng/directive/aSpec.js')
| -rw-r--r-- | test/ng/directive/aSpec.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/ng/directive/aSpec.js b/test/ng/directive/aSpec.js index a284f4bc..dc0de729 100644 --- a/test/ng/directive/aSpec.js +++ b/test/ng/directive/aSpec.js @@ -58,4 +58,30 @@ describe('a', function() { expect(element.text()).toBe('hello@you'); }); + + + it('should not link and hookup an event if href is present at compile', function() { + var jq = jQuery || jqLite; + element = jq('<a href="//a.com">hello@you</a>'); + var linker = $compile(element); + + spyOn(jq.prototype, 'on'); + + linker($rootScope); + + expect(jq.prototype.on).not.toHaveBeenCalled(); + }); + + + it('should not link and hookup an event if name is present at compile', function() { + var jq = jQuery || jqLite; + element = jq('<a name="bobby">hello@you</a>'); + var linker = $compile(element); + + spyOn(jq.prototype, 'on'); + + linker($rootScope); + + expect(jq.prototype.on).not.toHaveBeenCalled(); + }); }); |
