Skip to content

Commit

Permalink
test(parse): Test for the parsing not invoking twice to get self
Browse files Browse the repository at this point in the history
New test to not call twice a function to get self
  • Loading branch information
lgalfaso committed Apr 24, 2013
1 parent 2d5297e commit 2629f7f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/ng/parseSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,17 @@ describe('parser', function() {
});


it('should call the function once when it is part of the context', function() {
var count = 0;
scope.fn = function() {
count++;
};
scope.fn.anotherFn = function() { return ''; };
expect(scope.$eval('fn().anotherFn()')).toBe('');
expect(count).toBe(1);
});


describe('promises', function() {
var deferred, promise, q;

Expand Down

0 comments on commit 2629f7f

Please sign in to comment.