diff options
| author | Igor Minar | 2012-03-09 00:00:05 -0800 |
|---|---|---|
| committer | Igor Minar | 2012-03-09 16:14:26 -0800 |
| commit | f4d338d393dabb49182d40b4fe90c4d1b51621c0 (patch) | |
| tree | 6c20fbef9865869e9db44f27c53aec11f1e30d5e /test/directive | |
| parent | 0bfaa579c04d1b7cd21fbe16bfbc47a684f223b3 (diff) | |
| download | angular.js-f4d338d393dabb49182d40b4fe90c4d1b51621c0.tar.bz2 | |
chore(*): refactor all ng: to ng-
Diffstat (limited to 'test/directive')
| -rw-r--r-- | test/directive/booleanAttrDirSpecs.js | 22 | ||||
| -rw-r--r-- | test/directive/formSpec.js | 6 | ||||
| -rw-r--r-- | test/directive/inputSpec.js | 110 | ||||
| -rw-r--r-- | test/directive/ngBindSpec.js | 24 | ||||
| -rw-r--r-- | test/directive/ngClassSpec.js | 40 | ||||
| -rw-r--r-- | test/directive/ngClickSpec.js | 6 | ||||
| -rw-r--r-- | test/directive/ngCloakSpec.js | 10 | ||||
| -rw-r--r-- | test/directive/ngControllerSpec.js | 10 | ||||
| -rw-r--r-- | test/directive/ngEventDirsSpec.js | 4 | ||||
| -rw-r--r-- | test/directive/ngIncludeSpec.js | 8 | ||||
| -rw-r--r-- | test/directive/ngInitSpec.js | 6 | ||||
| -rw-r--r-- | test/directive/ngNonBindableSpec.js | 4 | ||||
| -rw-r--r-- | test/directive/ngPluralizeSpec.js | 2 | ||||
| -rw-r--r-- | test/directive/ngRepeatSpec.js | 42 | ||||
| -rw-r--r-- | test/directive/ngShowHideSpec.js | 12 | ||||
| -rw-r--r-- | test/directive/ngStyleSpec.js | 8 | ||||
| -rw-r--r-- | test/directive/ngSwitchSpec.js | 10 | ||||
| -rw-r--r-- | test/directive/ngViewSpec.js | 10 | ||||
| -rw-r--r-- | test/directive/selectSpec.js | 78 |
19 files changed, 207 insertions, 205 deletions
diff --git a/test/directive/booleanAttrDirSpecs.js b/test/directive/booleanAttrDirSpecs.js index 2c47d81a..8d71c2d8 100644 --- a/test/directive/booleanAttrDirSpecs.js +++ b/test/directive/booleanAttrDirSpecs.js @@ -9,7 +9,7 @@ describe('boolean attr directives', function() { it('should bind href', inject(function($rootScope, $compile) { - element = $compile('<a ng:href="{{url}}"></a>')($rootScope) + element = $compile('<a ng-href="{{url}}"></a>')($rootScope) $rootScope.url = 'http://server' $rootScope.$digest(); expect(element.attr('href')).toEqual('http://server'); @@ -17,7 +17,7 @@ describe('boolean attr directives', function() { it('should bind disabled', inject(function($rootScope, $compile) { - element = $compile('<button ng:disabled="{{isDisabled}}">Button</button>')($rootScope) + element = $compile('<button ng-disabled="{{isDisabled}}">Button</button>')($rootScope) $rootScope.isDisabled = false; $rootScope.$digest(); expect(element.attr('disabled')).toBeFalsy(); @@ -28,7 +28,7 @@ describe('boolean attr directives', function() { it('should bind checked', inject(function($rootScope, $compile) { - element = $compile('<input type="checkbox" ng:checked="{{isChecked}}" />')($rootScope) + element = $compile('<input type="checkbox" ng-checked="{{isChecked}}" />')($rootScope) $rootScope.isChecked = false; $rootScope.$digest(); expect(element.attr('checked')).toBeFalsy(); @@ -39,7 +39,7 @@ describe('boolean attr directives', function() { it('should bind selected', inject(function($rootScope, $compile) { - element = $compile('<select><option value=""></option><option ng:selected="{{isSelected}}">Greetings!</option></select>')($rootScope) + element = $compile('<select><option value=""></option><option ng-selected="{{isSelected}}">Greetings!</option></select>')($rootScope) jqLite(document.body).append(element) $rootScope.isSelected=false; $rootScope.$digest(); @@ -51,7 +51,7 @@ describe('boolean attr directives', function() { it('should bind readonly', inject(function($rootScope, $compile) { - element = $compile('<input type="text" ng:readonly="{{isReadonly}}" />')($rootScope) + element = $compile('<input type="text" ng-readonly="{{isReadonly}}" />')($rootScope) $rootScope.isReadonly=false; $rootScope.$digest(); expect(element.attr('readOnly')).toBeFalsy(); @@ -62,7 +62,7 @@ describe('boolean attr directives', function() { it('should bind multiple', inject(function($rootScope, $compile) { - element = $compile('<select ng:multiple="{{isMultiple}}"></select>')($rootScope) + element = $compile('<select ng-multiple="{{isMultiple}}"></select>')($rootScope) $rootScope.isMultiple=false; $rootScope.$digest(); expect(element.attr('multiple')).toBeFalsy(); @@ -73,7 +73,7 @@ describe('boolean attr directives', function() { it('should bind src', inject(function($rootScope, $compile) { - element = $compile('<div ng:src="{{url}}" />')($rootScope) + element = $compile('<div ng-src="{{url}}" />')($rootScope) $rootScope.url = 'http://localhost/'; $rootScope.$digest(); expect(element.attr('src')).toEqual('http://localhost/'); @@ -81,7 +81,7 @@ describe('boolean attr directives', function() { it('should bind href and merge with other attrs', inject(function($rootScope, $compile) { - element = $compile('<a ng:href="{{url}}" rel="{{rel}}"></a>')($rootScope); + element = $compile('<a ng-href="{{url}}" rel="{{rel}}"></a>')($rootScope); $rootScope.url = 'http://server'; $rootScope.rel = 'REL'; $rootScope.$digest(); @@ -92,18 +92,18 @@ describe('boolean attr directives', function() { it('should bind Text with no Bindings', inject(function($compile, $rootScope) { forEach(['checked', 'disabled', 'multiple', 'readonly', 'selected'], function(name) { - element = $compile('<div ng:' + name + '="some"></div>')($rootScope) + element = $compile('<div ng-' + name + '="some"></div>')($rootScope) $rootScope.$digest(); expect(element.attr(name)).toBe(name); dealoc(element); }); - element = $compile('<div ng:src="some"></div>')($rootScope) + element = $compile('<div ng-src="some"></div>')($rootScope) $rootScope.$digest(); expect(element.attr('src')).toEqual('some'); dealoc(element); - element = $compile('<div ng:href="some"></div>')($rootScope) + element = $compile('<div ng-href="some"></div>')($rootScope) $rootScope.$digest(); expect(element.attr('href')).toEqual('some'); dealoc(element); diff --git a/test/directive/formSpec.js b/test/directive/formSpec.js index 6387241f..6559da5d 100644 --- a/test/directive/formSpec.js +++ b/test/directive/formSpec.js @@ -34,7 +34,7 @@ describe('form', function() { it('should remove the widget when element removed', function() { doc = $compile( '<form name="form">' + - '<input type="text" name="alias" ng:model="value" store-model-ctrl/>' + + '<input type="text" name="alias" ng-model="value" store-model-ctrl/>' + '</form>')(scope); var form = scope.form; @@ -150,7 +150,7 @@ describe('form', function() { it('should publish widgets', function() { - doc = jqLite('<form name="form"><input type="text" name="w1" ng:model="some" /></form>'); + doc = jqLite('<form name="form"><input type="text" name="w1" ng-model="some" /></form>'); $compile(doc)(scope); var widget = scope.form.w1; @@ -167,7 +167,7 @@ describe('form', function() { beforeEach(function() { doc = $compile( '<form name="form">' + - '<input type="text" ng:model="name" name="name" store-model-ctrl/>' + + '<input type="text" ng-model="name" name="name" store-model-ctrl/>' + '</form>')(scope); scope.$digest(); diff --git a/test/directive/inputSpec.js b/test/directive/inputSpec.js index 54f3f7cd..5a0c4168 100644 --- a/test/directive/inputSpec.js +++ b/test/directive/inputSpec.js @@ -204,11 +204,11 @@ describe('NgModelController', function() { }); }); -describe('ng:model', function() { +describe('ng-model', function() { it('should set css classes (ng-valid, ng-invalid, ng-pristine, ng-dirty)', inject(function($compile, $rootScope) { - var element = $compile('<input type="email" ng:model="value" />')($rootScope); + var element = $compile('<input type="email" ng-model="value" />')($rootScope); $rootScope.$digest(); expect(element).toBeValid(); @@ -260,7 +260,7 @@ describe('input', function() { it('should bind to a model', function() { - compileInput('<input type="text" ng:model="name" name="alias" ng:change="change()" />'); + compileInput('<input type="text" ng-model="name" name="alias" ng-change="change()" />'); scope.$apply(function() { scope.name = 'misko'; @@ -271,7 +271,7 @@ describe('input', function() { it('should call $destroy on element remove', function() { - compileInput('<input type="text" ng:model="name" name="alias" ng:change="change()" />'); + compileInput('<input type="text" ng-model="name" name="alias" ng-change="change()" />'); var spy = jasmine.createSpy('on destroy'); scope.$on('$destroy', spy); @@ -282,7 +282,7 @@ describe('input', function() { it('should update the model on "blur" event', function() { - compileInput('<input type="text" ng:model="name" name="alias" ng:change="change()" />'); + compileInput('<input type="text" ng-model="name" name="alias" ng-change="change()" />'); changeInputValueTo('adam'); expect(scope.name).toEqual('adam'); @@ -290,7 +290,7 @@ describe('input', function() { it('should update the model and trim the value', function() { - compileInput('<input type="text" ng:model="name" name="alias" ng:change="change()" />'); + compileInput('<input type="text" ng-model="name" name="alias" ng-change="change()" />'); changeInputValueTo(' a '); expect(scope.name).toEqual('a'); @@ -298,7 +298,7 @@ describe('input', function() { it('should allow complex reference binding', function() { - compileInput('<input type="text" ng:model="obj[\'abc\'].name"/>'); + compileInput('<input type="text" ng-model="obj[\'abc\'].name"/>'); scope.$apply(function() { scope.obj = { abc: { name: 'Misko'} }; @@ -307,7 +307,7 @@ describe('input', function() { }); - it('should ignore input without ng:model attr', function() { + it('should ignore input without ng-model attr', function() { compileInput('<input type="text" name="whatever" required />'); browserTrigger(inputElm, 'blur'); @@ -320,14 +320,14 @@ describe('input', function() { it('should report error on assignment error', function() { expect(function() { - compileInput('<input type="text" ng:model="throw \'\'">'); + compileInput('<input type="text" ng-model="throw \'\'">'); scope.$digest(); }).toThrow("Syntax Error: Token '''' is an unexpected token at column 7 of the expression [throw ''] starting at ['']."); }); it("should render as blank if null", function() { - compileInput('<input type="text" ng:model="age" />'); + compileInput('<input type="text" ng-model="age" />'); scope.$apply(function() { scope.age = null; @@ -339,7 +339,7 @@ describe('input', function() { it('should render 0 even if it is a number', function() { - compileInput('<input type="text" ng:model="value" />'); + compileInput('<input type="text" ng-model="value" />'); scope.$apply(function() { scope.value = 0; }); @@ -351,7 +351,7 @@ describe('input', function() { describe('pattern', function() { it('should validate in-lined pattern', function() { - compileInput('<input type="text" ng:model="value" ng:pattern="/^\\d\\d\\d-\\d\\d-\\d\\d\\d\\d$/" />'); + compileInput('<input type="text" ng-model="value" ng-pattern="/^\\d\\d\\d-\\d\\d-\\d\\d\\d\\d$/" />'); scope.$digest(); changeInputValueTo('x000-00-0000x'); @@ -372,7 +372,7 @@ describe('input', function() { it('should validate pattern from scope', function() { - compileInput('<input type="text" ng:model="value" ng:pattern="regexp" />'); + compileInput('<input type="text" ng-model="value" ng-pattern="regexp" />'); scope.regexp = /^\d\d\d-\d\d-\d\d\d\d$/; scope.$digest(); @@ -402,7 +402,7 @@ describe('input', function() { xit('should throw an error when scope pattern can\'t be found', function() { - compileInput('<input type="text" ng:model="foo" ng:pattern="fooRegexp" />'); + compileInput('<input type="text" ng-model="foo" ng-pattern="fooRegexp" />'); expect(function() { changeInputValueTo('xx'); }). toThrow('Expected fooRegexp to be a RegExp but was undefined'); @@ -413,7 +413,7 @@ describe('input', function() { describe('minlength', function() { it('should invalid shorter than given minlenght', function() { - compileInput('<input type="text" ng:model="value" ng:minlength="3" />'); + compileInput('<input type="text" ng-model="value" ng-minlength="3" />'); changeInputValueTo('aa'); expect(scope.value).toBeUndefined(); @@ -427,7 +427,7 @@ describe('input', function() { describe('maxlength', function() { it('should invalid shorter than given maxlenght', function() { - compileInput('<input type="text" ng:model="value" ng:maxlength="5" />'); + compileInput('<input type="text" ng-model="value" ng-maxlength="5" />'); changeInputValueTo('aaaaaaaa'); expect(scope.value).toBeUndefined(); @@ -443,7 +443,7 @@ describe('input', function() { describe('number', function() { it('should not update model if view invalid', function() { - compileInput('<input type="number" ng:model="age"/>'); + compileInput('<input type="number" ng-model="age"/>'); scope.$apply(function() { scope.age = 123; @@ -465,7 +465,7 @@ describe('input', function() { it('should render as blank if null', function() { - compileInput('<input type="number" ng:model="age" />'); + compileInput('<input type="number" ng-model="age" />'); scope.$apply(function() { scope.age = null; @@ -477,7 +477,7 @@ describe('input', function() { it('should come up blank when no value specified', function() { - compileInput('<input type="number" ng:model="age" />'); + compileInput('<input type="number" ng-model="age" />'); scope.$digest(); expect(inputElm.val()).toBe(''); @@ -492,7 +492,7 @@ describe('input', function() { it('should parse empty string to null', function() { - compileInput('<input type="number" ng:model="age" />'); + compileInput('<input type="number" ng-model="age" />'); scope.$apply(function() { scope.age = 10; @@ -507,7 +507,7 @@ describe('input', function() { describe('min', function() { it('should validate', function() { - compileInput('<input type="number" ng:model="value" name="alias" min="10" />'); + compileInput('<input type="number" ng-model="value" name="alias" min="10" />'); scope.$digest(); changeInputValueTo('1'); @@ -526,7 +526,7 @@ describe('input', function() { describe('max', function() { it('should validate', function() { - compileInput('<input type="number" ng:model="value" name="alias" max="10" />'); + compileInput('<input type="number" ng-model="value" name="alias" max="10" />'); scope.$digest(); changeInputValueTo('20'); @@ -545,7 +545,7 @@ describe('input', function() { describe('required', function() { it('should be valid even if value is 0', function() { - compileInput('<input type="number" ng:model="value" name="alias" required />'); + compileInput('<input type="number" ng-model="value" name="alias" required />'); changeInputValueTo('0'); expect(inputElm).toBeValid(); @@ -554,7 +554,7 @@ describe('input', function() { }); it('should be valid even if value 0 is set from model', function() { - compileInput('<input type="number" ng:model="value" name="alias" required />'); + compileInput('<input type="number" ng-model="value" name="alias" required />'); scope.$apply(function() { scope.value = 0; @@ -570,7 +570,7 @@ describe('input', function() { describe('email', function() { it('should validate e-mail', function() { - compileInput('<input type="email" ng:model="email" name="alias" />'); + compileInput('<input type="email" ng-model="email" name="alias" />'); var widget = scope.form.alias; changeInputValueTo('vojta@google.com'); @@ -599,7 +599,7 @@ describe('input', function() { describe('url', function() { it('should validate url', function() { - compileInput('<input type="url" ng:model="url" name="alias" />'); + compileInput('<input type="url" ng-model="url" name="alias" />'); var widget = scope.form.alias; changeInputValueTo('http://www.something.com'); @@ -628,9 +628,9 @@ describe('input', function() { it('should update the model', function() { compileInput( - '<input type="radio" ng:model="color" value="white" />' + - '<input type="radio" ng:model="color" value="red" />' + - '<input type="radio" ng:model="color" value="blue" />'); + '<input type="radio" ng-model="color" value="white" />' + + '<input type="radio" ng-model="color" value="red" />' + + '<input type="radio" ng-model="color" value="blue" />'); scope.$apply(function() { scope.color = 'white'; @@ -655,8 +655,8 @@ describe('input', function() { xit('should allow {{expr}} as value', function() { scope.some = 11; compileInput( - '<input type="radio" ng:model="value" value="{{some}}" />' + - '<input type="radio" ng:model="value" value="{{other}}" />'); + '<input type="radio" ng-model="value" value="{{some}}" />' + + '<input type="radio" ng-model="value" value="{{other}}" />'); browserTrigger(inputElm[0]); expect(scope.value).toBe(true); @@ -669,7 +669,7 @@ describe('input', function() { describe('checkbox', function() { - it('should ignore checkbox without ng:model attr', function() { + it('should ignore checkbox without ng-model attr', function() { compileInput('<input type="checkbox" name="whatever" required />'); browserTrigger(inputElm, 'blur'); @@ -681,7 +681,7 @@ describe('input', function() { it('should format booleans', function() { - compileInput('<input type="checkbox" ng:model="name" />'); + compileInput('<input type="checkbox" ng-model="name" />'); scope.$apply(function() { scope.name = false; @@ -696,7 +696,7 @@ describe('input', function() { it('should support type="checkbox" with non-standard capitalization', function() { - compileInput('<input type="checkBox" ng:model="checkbox" />'); + compileInput('<input type="checkBox" ng-model="checkbox" />'); browserTrigger(inputElm, 'click'); expect(scope.checkbox).toBe(true); @@ -707,8 +707,8 @@ describe('input', function() { it('should allow custom enumeration', function() { - compileInput('<input type="checkbox" ng:model="name" ng:true-value="y" ' + - 'ng:false-value="n">'); + compileInput('<input type="checkbox" ng-model="name" ng-true-value="y" ' + + 'ng-false-value="n">'); scope.$apply(function() { scope.name = 'y'; @@ -737,7 +737,7 @@ describe('input', function() { describe('textarea', function() { it("should process textarea", function() { - compileInput('<textarea ng:model="name"></textarea>'); + compileInput('<textarea ng-model="name"></textarea>'); inputElm = formElm.find('textarea'); scope.$apply(function() { @@ -753,7 +753,7 @@ describe('input', function() { }); - it('should ignore textarea without ng:model attr', function() { + it('should ignore textarea without ng-model attr', function() { compileInput('<textarea name="whatever" required></textarea>'); inputElm = formElm.find('textarea'); @@ -766,10 +766,10 @@ describe('input', function() { }); - describe('ng:list', function() { + describe('ng-list', function() { it('should parse text into an array', function() { - compileInput('<input type="text" ng:model="list" ng:list />'); + compileInput('<input type="text" ng-model="list" ng-list />'); // model -> view scope.$apply(function() { @@ -787,7 +787,7 @@ describe('input', function() { // When the user types 'a,b' the 'a,' stage parses to ['a'] but if the // $parseModel function runs it will change to 'a', in essence preventing // the user from ever typying ','. - compileInput('<input type="text" ng:model="list" ng:list />'); + compileInput('<input type="text" ng-model="list" ng-list />'); changeInputValueTo('a '); expect(inputElm.val()).toEqual('a '); @@ -808,7 +808,7 @@ describe('input', function() { xit('should require at least one item', function() { - compileInput('<input type="text" ng:model="list" ng:list required />'); + compileInput('<input type="text" ng-model="list" ng-list required />'); changeInputValueTo(' , '); expect(inputElm).toBeInvalid(); @@ -816,7 +816,7 @@ describe('input', function() { it('should convert empty string to an empty array', function() { - compileInput('<input type="text" ng:model="list" ng:list />'); + compileInput('<input type="text" ng-model="list" ng-list />'); changeInputValueTo(''); expect(scope.list).toEqual([]); @@ -826,7 +826,7 @@ describe('input', function() { describe('required', function() { it('should allow bindings on required', function() { - compileInput('<input type="text" ng:model="value" required="{{required}}" />'); + compileInput('<input type="text" ng-model="value" required="{{required}}" />'); scope.$apply(function() { scope.required = false; @@ -857,7 +857,7 @@ describe('input', function() { it('should invalid initial value with bound required', function() { - compileInput('<input type="text" ng:model="value" required="{{required}}" />'); + compileInput('<input type="text" ng-model="value" required="{{required}}" />'); scope.$apply(function() { scope.required = true; @@ -868,7 +868,7 @@ describe('input', function() { it('should be $invalid but $pristine if not touched', function() { - compileInput('<input type="text" ng:model="name" name="alias" required />'); + compileInput('<input type="text" ng-model="name" name="alias" required />'); scope.$apply(function() { scope.name = ''; @@ -884,7 +884,7 @@ describe('input', function() { it('should allow empty string if not required', function() { - compileInput('<input type="text" ng:model="foo" />'); + compileInput('<input type="text" ng-model="foo" />'); changeInputValueTo('a'); changeInputValueTo(''); expect(scope.foo).toBe(''); @@ -892,17 +892,17 @@ describe('input', function() { it('should set $invalid when model undefined', function() { - compileInput('<input type="text" ng:model="notDefiend" required />'); + compileInput('<input type="text" ng-model="notDefiend" required />'); scope.$digest(); expect(inputElm).toBeInvalid(); }) }); - describe('ng:change', function() { + describe('ng-change', function() { it('should $eval expression after new value is set in the model', function() { - compileInput('<input type="text" ng:model="value" ng:change="change()" />'); + compileInput('<input type="text" ng-model="value" ng-change="change()" />'); scope.change = jasmine.createSpy('change').andCallFake(function() { expect(scope.value).toBe('new value'); @@ -913,7 +913,7 @@ describe('input', function() { }); it('should not $eval the expression if changed from model', function() { - compileInput('<input type="text" ng:model="value" ng:change="change()" />'); + compileInput('<input type="text" ng-model="value" ng-change="change()" />'); scope.change = jasmine.createSpy('change'); scope.$apply(function() { @@ -924,8 +924,8 @@ describe('input', function() { }); - it('should $eval ng:change expression on checkbox', function() { - compileInput('<input type="checkbox" ng:model="foo" ng:change="changeFn()">'); + it('should $eval ng-change expression on checkbox', function() { + compileInput('<input type="checkbox" ng-model="foo" ng-change="changeFn()">'); scope.changeFn = jasmine.createSpy('changeFn'); scope.$digest(); @@ -937,10 +937,10 @@ describe('input', function() { }); - describe('ng:model-instant', function() { + describe('ng-model-instant', function() { it('should bind keydown, change, input events', inject(function($browser) { - compileInput('<input type="text" ng:model="value" ng:model-instant />'); + compileInput('<input type="text" ng-model="value" ng-model-instant />'); inputElm.val('value1'); browserTrigger(inputElm, 'keydown'); diff --git a/test/directive/ngBindSpec.js b/test/directive/ngBindSpec.js index e8c07494..ddfdd53d 100644 --- a/test/directive/ngBindSpec.js +++ b/test/directive/ngBindSpec.js @@ -1,6 +1,6 @@ 'use strict'; -describe('ng:bind-*', function() { +describe('ng-bind-*', function() { var element; @@ -9,10 +9,10 @@ describe('ng:bind-*', function() { }); - describe('ng:bind', function() { + describe('ng-bind', function() { it('should set text', inject(function($rootScope, $compile) { - element = $compile('<div ng:bind="a"></div>')($rootScope); + element = $compile('<div ng-bind="a"></div>')($rootScope); expect(element.text()).toEqual(''); $rootScope.a = 'misko'; $rootScope.$digest(); @@ -21,7 +21,7 @@ describe('ng:bind-*', function() { })); it('should set text to blank if undefined', inject(function($rootScope, $compile) { - element = $compile('<div ng:bind="a"></div>')($rootScope); + element = $compile('<div ng-bind="a"></div>')($rootScope); $rootScope.a = 'misko'; $rootScope.$digest(); expect(element.text()).toEqual('misko'); @@ -34,14 +34,14 @@ describe('ng:bind-*', function() { })); it('should set html', inject(function($rootScope, $compile) { - element = $compile('<div ng:bind-html="html"></div>')($rootScope); + element = $compile('<div ng-bind-html="html"></div>')($rootScope); $rootScope.html = '<div unknown>hello</div>'; $rootScope.$digest(); expect(lowercase(element.html())).toEqual('<div>hello</div>'); })); it('should set unsafe html', inject(function($rootScope, $compile) { - element = $compile('<div ng:bind-html-unsafe="html"></div>')($rootScope); + element = $compile('<div ng-bind-html-unsafe="html"></div>')($rootScope); $rootScope.html = '<div onclick="">hello</div>'; $rootScope.$digest(); expect(lowercase(element.html())).toEqual('<div onclick="">hello</div>'); @@ -61,10 +61,10 @@ describe('ng:bind-*', function() { }); - describe('ng:bind-template', function() { + describe('ng-bind-template', function() { - it('should ng:bind-template', inject(function($rootScope, $compile) { - element = $compile('<div ng:bind-template="Hello {{name}}!"></div>')($rootScope); + it('should ng-bind-template', inject(function($rootScope, $compile) { + element = $compile('<div ng-bind-template="Hello {{name}}!"></div>')($rootScope); $rootScope.name = 'Misko'; $rootScope.$digest(); expect(element.hasClass('ng-binding')).toEqual(true); @@ -79,9 +79,9 @@ describe('ng:bind-*', function() { }); - describe('ng:bind-attr', function() { + describe('ng-bind-attr', function() { it('should bind attributes', inject(function($rootScope, $compile) { - element = $compile('<div ng:bind-attr="{src:\'http://localhost/mysrc\', alt:\'myalt\'}"/>')($rootScope); + element = $compile('<div ng-bind-attr="{src:\'http://localhost/mysrc\', alt:\'myalt\'}"/>')($rootScope); $rootScope.$digest(); expect(element.attr('src')).toEqual('http://localhost/mysrc'); expect(element.attr('alt')).toEqual('myalt'); @@ -94,7 +94,7 @@ describe('ng:bind-*', function() { })); it('should remove special attributes on false', inject(function($rootScope, $compile) { - element = $compile('<input ng:bind-attr="{disabled:\'{{disabled}}\', readonly:\'{{readonly}}\', checked:\'{{checked}}\'}"/>')($rootScope); + element = $compile('<input ng-bind-attr="{disabled:\'{{disabled}}\', readonly:\'{{readonly}}\', checked:\'{{checked}}\'}"/>')($rootScope); var input = element[0]; expect(input.disabled).toEqual(false); expect(input.readOnly).toEqual(false); diff --git a/test/directive/ngClassSpec.js b/test/directive/ngClassSpec.js index a8b6b17e..2297e343 100644 --- a/test/directive/ngClassSpec.js +++ b/test/directive/ngClassSpec.js @@ -1,6 +1,6 @@ 'use strict'; -describe('ng:class', function() { +describe('ng-class', function() { var element; @@ -10,7 +10,7 @@ describe('ng:class', function() { it('should add new and remove old classes dynamically', inject(function($rootScope, $compile) { - element = $compile('<div class="existing" ng:class="dynClass"></div>')($rootScope); + element = $compile('<div class="existing" ng-class="dynClass"></div>')($rootScope); $rootScope.dynClass = 'A'; $rootScope.$digest(); expect(element.hasClass('existing')).toBe(true); @@ -31,7 +31,7 @@ describe('ng:class', function() { it('should support adding multiple classes via an array', inject(function($rootScope, $compile) { - element = $compile('<div class="existing" ng:class="[\'A\', \'B\']"></div>')($rootScope); + element = $compile('<div class="existing" ng-class="[\'A\', \'B\']"></div>')($rootScope); $rootScope.$digest(); expect(element.hasClass('existing')).toBeTruthy(); expect(element.hasClass('A')).toBeTruthy(); @@ -43,7 +43,7 @@ describe('ng:class', function() { 'expressions', inject(function($rootScope, $compile) { var element = $compile( '<div class="existing" ' + - 'ng:class="{A: conditionA, B: conditionB(), AnotB: conditionA&&!conditionB}">' + + 'ng-class="{A: conditionA, B: conditionB(), AnotB: conditionA&&!conditionB}">' + '</div>')($rootScope); $rootScope.conditionA = true; $rootScope.$digest(); @@ -62,7 +62,7 @@ describe('ng:class', function() { it('should support adding multiple classes via a space delimited string', inject(function($rootScope, $compile) { - element = $compile('<div class="existing" ng:class="\'A B\'"></div>')($rootScope); + element = $compile('<div class="existing" ng-class="\'A B\'"></div>')($rootScope); $rootScope.$digest(); expect(element.hasClass('existing')).toBeTruthy(); expect(element.hasClass('A')).toBeTruthy(); @@ -71,7 +71,7 @@ describe('ng:class', function() { it('should preserve class added post compilation with pre-existing classes', inject(function($rootScope, $compile) { - element = $compile('<div class="existing" ng:class="dynClass"></div>')($rootScope); + element = $compile('<div class="existing" ng-class="dynClass"></div>')($rootScope); $rootScope.dynClass = 'A'; $rootScope.$digest(); expect(element.hasClass('existing')).toBe(true); @@ -88,7 +88,7 @@ describe('ng:class', function() { it('should preserve class added post compilation without pre-existing classes"', inject(function($rootScope, $compile) { - element = $compile('<div ng:class="dynClass"></div>')($rootScope); + element = $compile('<div ng-class="dynClass"></div>')($rootScope); $rootScope.dynClass = 'A'; $rootScope.$digest(); expect(element.hasClass('A')).toBe(true); @@ -104,7 +104,7 @@ describe('ng:class', function() { it('should preserve other classes with similar name"', inject(function($rootScope, $compile) { - element = $compile('<div class="ui-panel ui-selected" ng:class="dynCls"></div>')($rootScope); + element = $compile('<div class="ui-panel ui-selected" ng-class="dynCls"></div>')($rootScope); $rootScope.dynCls = 'panel'; $rootScope.$digest(); $rootScope.dynCls = 'foo'; @@ -114,7 +114,7 @@ describe('ng:class', function() { it('should not add duplicate classes', inject(function($rootScope, $compile) { - element = $compile('<div class="panel bar" ng:class="dynCls"></div>')($rootScope); + element = $compile('<div class="panel bar" ng-class="dynCls"></div>')($rootScope); $rootScope.dynCls = 'panel'; $rootScope.$digest(); expect(element[0].className).toBe('panel bar ng-scope'); @@ -122,7 +122,7 @@ describe('ng:class', function() { it('should remove classes even if it was specified via class attribute', inject(function($rootScope, $compile) { - element = $compile('<div class="panel bar" ng:class="dynCls"></div>')($rootScope); + element = $compile('<div class="panel bar" ng-class="dynCls"></div>')($rootScope); $rootScope.dynCls = 'panel'; $rootScope.$digest(); $rootScope.dynCls = 'window'; @@ -132,7 +132,7 @@ describe('ng:class', function() { it('should remove classes even if they were added by another code', inject(function($rootScope, $compile) { - element = $compile('<div ng:class="dynCls"></div>')($rootScope); + element = $compile('<div ng-class="dynCls"></div>')($rootScope); $rootScope.dynCls = 'foo'; $rootScope.$digest(); element.addClass('foo'); @@ -142,14 +142,14 @@ describe('ng:class', function() { it('should convert undefined and null values to an empty string', inject(function($rootScope, $compile) { - element = $compile('<div ng:class="dynCls"></div>')($rootScope); + element = $compile('<div ng-class="dynCls"></div>')($rootScope); $rootScope.dynCls = [undefined, null]; $rootScope.$digest(); })); - it('should ng:class odd/even', inject(function($rootScope, $compile) { - element = $compile('<ul><li ng:repeat="i in [0,1]" class="existing" ng:class-odd="\'odd\'" ng:class-even="\'even\'"></li><ul>')($rootScope); + it('should ng-class odd/even', inject(function($rootScope, $compile) { + element = $compile('<ul><li ng-repeat="i in [0,1]" class="existing" ng-class-odd="\'odd\'" ng-class-even="\'even\'"></li><ul>')($rootScope); $rootScope.$digest(); var e1 = jqLite(element[0].childNodes[1]); var e2 = jqLite(element[0].childNodes[2]); @@ -160,10 +160,10 @@ describe('ng:class', function() { })); - it('should allow both ng:class and ng:class-odd/even on the same element', inject(function($rootScope, $compile) { + it('should allow both ng-class and ng-class-odd/even on the same element', inject(function($rootScope, $compile) { element = $compile('<ul>' + - '<li ng:repeat="i in [0,1]" ng:class="\'plainClass\'" ' + - 'ng:class-odd="\'odd\'" ng:class-even="\'even\'"></li>' + + '<li ng-repeat="i in [0,1]" ng-class="\'plainClass\'" ' + + 'ng-class-odd="\'odd\'" ng-class-even="\'even\'"></li>' + '<ul>')($rootScope); $rootScope.$apply(); var e1 = jqLite(element[0].childNodes[1]); @@ -178,10 +178,10 @@ describe('ng:class', function() { })); - it('should allow both ng:class and ng:class-odd/even with multiple classes', inject(function($rootScope, $compile) { + it('should allow both ng-class and ng-class-odd/even with multiple classes', inject(function($rootScope, $compile) { element = $compile('<ul>' + - '<li ng:repeat="i in [0,1]" ng:class="[\'A\', \'B\']" ' + - 'ng:class-odd="[\'C\', \'D\']" ng:class-even="[\'E\', \'F\']"></li>' + + '<li ng-repeat="i in [0,1]" ng-class="[\'A\', \'B\']" ' + + 'ng-class-odd="[\'C\', \'D\']" ng-class-even="[\'E\', \'F\']"></li>' + '<ul>')($rootScope); $rootScope.$apply(); var e1 = jqLite(element[0].childNodes[1]); diff --git a/test/directive/ngClickSpec.js b/test/directive/ngClickSpec.js index cb52901c..f5086d1c 100644 --- a/test/directive/ngClickSpec.js +++ b/test/directive/ngClickSpec.js @@ -1,6 +1,6 @@ 'use strict'; -describe('ng:click', function() { +describe('ng-click', function() { var element; afterEach(function() { @@ -8,7 +8,7 @@ describe('ng:click', function() { }); it('should get called on a click', inject(function($rootScope, $compile) { - element = $compile('<div ng:click="clicked = true"></div>')($rootScope); + element = $compile('<div ng-click="clicked = true"></div>')($rootScope); $rootScope.$digest(); expect($rootScope.clicked).toBeFalsy(); @@ -17,7 +17,7 @@ describe('ng:click', function() { })); it('should pass event object', inject(function($rootScope, $compile) { - element = $compile('<div ng:click="event = $event"></div>')($rootScope); + element = $compile('<div ng-click="event = $event"></div>')($rootScope); $rootScope.$digest(); browserTrigger(element, 'click'); diff --git a/test/directive/ngCloakSpec.js b/test/directive/ngCloakSpec.js index bd911f35..f3c28b60 100644 --- a/test/directive/ngCloakSpec.js +++ b/test/directive/ngCloakSpec.js @@ -1,6 +1,6 @@ 'use strict'; -describe('ng:cloak', function() { +describe('ng-cloak', function() { var element; @@ -10,16 +10,16 @@ describe('ng:cloak', function() { it('should get removed when an element is compiled', inject(function($rootScope, $compile) { - element = jqLite('<div ng:cloak></div>'); - expect(element.attr('ng:cloak')).toBe(''); + element = jqLite('<div ng-cloak></div>'); + expect(element.attr('ng-cloak')).toBe(''); $compile(element); - expect(element.attr('ng:cloak')).toBeUndefined(); + expect(element.attr('ng-cloak')).toBeUndefined(); })); it('should remove ng-cloak class from a compiled element with attribute', inject( function($rootScope, $compile) { - element = jqLite('<div ng:cloak class="foo ng-cloak bar"></div>'); + element = jqLite('<div ng-cloak class="foo ng-cloak bar"></div>'); expect(element.hasClass('foo')).toBe(true); expect(element.hasClass('ng-cloak')).toBe(true); diff --git a/test/directive/ngControllerSpec.js b/test/directive/ngControllerSpec.js index 3ab6b929..832a683d 100644 --- a/test/directive/ngControllerSpec.js +++ b/test/directive/ngControllerSpec.js @@ -1,6 +1,6 @@ 'use strict'; -describe('ng:controller', function() { +describe('ng-controller', function() { var element; beforeEach(inject(function($window) { @@ -35,19 +35,19 @@ describe('ng:controller', function() { it('should instantiate controller and bind methods', inject(function($compile, $rootScope) { - element = $compile('<div ng:controller="Greeter">{{greet(name)}}</div>')($rootScope); + element = $compile('<div ng-controller="Greeter">{{greet(name)}}</div>')($rootScope); $rootScope.$digest(); expect(element.text()).toBe('Hello Misko!'); })); it('should allow nested controllers', inject(function($compile, $rootScope) { - element = $compile('<div ng:controller="Greeter"><div ng:controller="Child">{{greet(name)}}</div></div>')($rootScope); + element = $compile('<div ng-controller="Greeter"><div ng-controller="Child">{{greet(name)}}</div></div>')($rootScope); $rootScope.$digest(); expect(element.text()).toBe('Hello Adam!'); dealoc(element); - element = $compile('<div ng:controller="Greeter"><div ng:controller="Child">{{protoGreet(name)}}</div></div>')($rootScope); + element = $compile('<div ng-controller="Greeter"><div ng-controller="Child">{{protoGreet(name)}}</div></div>')($rootScope); $rootScope.$digest(); expect(element.text()).toBe('Hello Adam!'); })); @@ -58,7 +58,7 @@ describe('ng:controller', function() { $scope.name = 'Vojta'; }; - element = $compile('<div ng:controller="Greeter">{{name}}</div>')($rootScope); + element = $compile('<div ng-controller="Greeter">{{name}}</div>')($rootScope); $rootScope.$digest(); expect(element.text()).toBe('Vojta'); })); diff --git a/test/directive/ngEventDirsSpec.js b/test/directive/ngEventDirsSpec.js index 2b14bb33..c42f9b26 100644 --- a/test/directive/ngEventDirsSpec.js +++ b/test/directive/ngEventDirsSpec.js @@ -9,10 +9,10 @@ describe('event directives', function() { }); - describe('ng:submit', function() { + describe('ng-submit', function() { it('should get called on form submit', inject(function($rootScope, $compile) { - element = $compile('<form action="" ng:submit="submitted = true">' + + element = $compile('<form action="" ng-submit="submitted = true">' + '<input type="submit"/>' + '</form>')($rootScope); $rootScope.$digest(); diff --git a/test/directive/ngIncludeSpec.js b/test/directive/ngIncludeSpec.js index dc761abc..32d760c3 100644 --- a/test/directive/ngIncludeSpec.js +++ b/test/directive/ngIncludeSpec.js @@ -1,6 +1,6 @@ 'use strict'; -describe('ng:include', function() { +describe('ng-include', function() { var element; @@ -19,12 +19,14 @@ describe('ng:include', function() { it('should include on external file', inject(putIntoCache('myUrl', '{{name}}'), function($rootScope, $compile, $browser) { element = jqLite('<ng:include src="url" scope="childScope"></ng:include>'); + jqLite(document.body).append(element); element = $compile(element)($rootScope); $rootScope.childScope = $rootScope.$new(); $rootScope.childScope.name = 'misko'; $rootScope.url = 'myUrl'; $rootScope.$digest(); expect(element.text()).toEqual('misko'); + jqLite(document.body).html(''); })); @@ -56,7 +58,7 @@ describe('ng:include', function() { // TODO(misko): because we are using scope==this, the eval gets registered // during the flush phase and hence does not get called. - // I don't think passing 'this' makes sense. Does having scope on ng:include makes sense? + // I don't think passing 'this' makes sense. Does having scope on ng-include makes sense? // should we make scope="this" illegal? $rootScope.$digest(); @@ -197,7 +199,7 @@ describe('ng:include', function() { $rootScope.$on('$includeContentLoaded', onload); $templateCache.put('tpl.html', [200, 'partial {{tpl}}', {}]); - element = $compile('<div><div ng:repeat="i in [1]">' + + element = $compile('<div><div ng-repeat="i in [1]">' + '<ng:include src="tpl"></ng:include></div></div>')($rootScope); expect(onload).not.toHaveBeenCalled(); diff --git a/test/directive/ngInitSpec.js b/test/directive/ngInitSpec.js index b096c7fd..92146089 100644 --- a/test/directive/ngInitSpec.js +++ b/test/directive/ngInitSpec.js @@ -1,6 +1,6 @@ 'use strict'; -describe('ng:init', function() { +describe('ng-init', function() { var element; @@ -9,8 +9,8 @@ describe('ng:init', function() { }); - it("should ng:init", inject(function($rootScope, $compile) { - element = $compile('<div ng:init="a=123"></div>')($rootScope); + it("should ng-init", inject(function($rootScope, $compile) { + element = $compile('<div ng-init="a=123"></div>')($rootScope); expect($rootScope.a).toEqual(123); })); }); diff --git a/test/directive/ngNonBindableSpec.js b/test/directive/ngNonBindableSpec.js index c974948d..8b745364 100644 --- a/test/directive/ngNonBindableSpec.js +++ b/test/directive/ngNonBindableSpec.js @@ -1,7 +1,7 @@ 'use strict'; -describe('ng:non-bindable', function() { +describe('ng-non-bindable', function() { var element; @@ -12,7 +12,7 @@ describe('ng:non-bindable', function() { it('should prevent compilation of the owning element and its children', inject(function($rootScope, $compile) { - element = $compile('<div ng:non-bindable><span ng:bind="name"></span></div>')($rootScope); + element = $compile('<div ng-non-bindable><span ng-bind="name"></span></div>')($rootScope); $rootScope.name = 'misko'; $rootScope.$digest(); expect(element.text()).toEqual(''); diff --git a/test/directive/ngPluralizeSpec.js b/test/directive/ngPluralizeSpec.js index 8046f45f..c7766c7b 100644 --- a/test/directive/ngPluralizeSpec.js +++ b/test/directive/ngPluralizeSpec.js @@ -1,6 +1,6 @@ 'use strict'; -describe('ng:pluralize', function() { +describe('ng-pluralize', function() { var element; diff --git a/test/directive/ngRepeatSpec.js b/test/directive/ngRepeatSpec.js index 8400edaa..8b6a5173 100644 --- a/test/directive/ngRepeatSpec.js +++ b/test/directive/ngRepeatSpec.js @@ -1,6 +1,6 @@ 'use strict'; -describe('ng:repeat', function() { +describe('ng-repeat', function() { var element; @@ -9,10 +9,10 @@ describe('ng:repeat', function() { }); - it('should ng:repeat over array', inject(function($rootScope, $compile) { + it('should ng-repeat over array', inject(function($rootScope, $compile) { element = $compile( '<ul>' + - '<li ng:repeat="item in items" ng:init="suffix = \';\'" ng:bind="item + suffix"></li>' + + '<li ng-repeat="item in items" ng-init="suffix = \';\'" ng-bind="item + suffix"></li>' + '</ul>')($rootScope); Array.prototype.extraProperty = "should be ignored"; @@ -37,10 +37,10 @@ describe('ng:repeat', function() { })); - it('should ng:repeat over object', inject(function($rootScope, $compile) { + it('should ng-repeat over object', inject(function($rootScope, $compile) { element = $compile( '<ul>' + - '<li ng:repeat="(key, value) in items" ng:bind="key + \':\' + value + \';\' "></li>' + + '<li ng-repeat="(key, value) in items" ng-bind="key + \':\' + value + \';\' "></li>' + '</ul>')($rootScope); $rootScope.items = {misko:'swe', shyam:'set'}; $rootScope.$digest(); @@ -48,14 +48,14 @@ describe('ng:repeat', function() { })); - it('should not ng:repeat over parent properties', inject(function($rootScope, $compile) { + it('should not ng-repeat over parent properties', inject(function($rootScope, $compile) { var Class = function() {}; Class.prototype.abc = function() {}; Class.prototype.value = 'abc'; element = $compile( '<ul>' + - '<li ng:repeat="(key, value) in items" ng:bind="key + \':\' + value + \';\' "></li>' + + '<li ng-repeat="(key, value) in items" ng-bind="key + \':\' + value + \';\' "></li>' + '</ul>')($rootScope); $rootScope.items = new Class(); $rootScope.items.name = 'value'; @@ -64,10 +64,10 @@ describe('ng:repeat', function() { })); - it('should error on wrong parsing of ng:repeat', inject(function($rootScope, $compile, $log) { + it('should error on wrong parsing of ng-repeat', inject(function($rootScope, $compile, $log) { expect(function() { - element = $compile('<ul><li ng:repeat="i dont parse"></li></ul>')($rootScope); - }).toThrow("Expected ng:repeat in form of '_item_ in _collection_' but got 'i dont parse'."); + element = $compile('<ul><li ng-repeat="i dont parse"></li></ul>')($rootScope); + }).toThrow("Expected ng-repeat in form of '_item_ in _collection_' but got 'i dont parse'."); $log.error.logs.shift(); })); @@ -77,7 +77,7 @@ describe('ng:repeat', function() { inject(function($rootScope, $compile) { element = $compile( '<ul>' + - '<li ng:repeat="item in items" ng:bind="item + $index + \'|\'"></li>' + + '<li ng-repeat="item in items" ng-bind="item + $index + \'|\'"></li>' + '</ul>')($rootScope); $rootScope.items = ['misko', 'shyam', 'frodo']; $rootScope.$digest(); @@ -89,7 +89,7 @@ describe('ng:repeat', function() { inject(function($rootScope, $compile) { element = $compile( '<ul>' + - '<li ng:repeat="(key, val) in items" ng:bind="key + \':\' + val + $index + \'|\'"></li>' + + '<li ng-repeat="(key, val) in items" ng-bind="key + \':\' + val + $index + \'|\'"></li>' + '</ul>')($rootScope); $rootScope.items = {'misko':'m', 'shyam':'s', 'frodo':'f'}; $rootScope.$digest(); @@ -101,7 +101,7 @@ describe('ng:repeat', function() { inject(function($rootScope, $compile) { element = $compile( '<ul>' + - '<li ng:repeat="item in items" ng:bind="item + \':\' + $position + \'|\'"></li>' + + '<li ng-repeat="item in items" ng-bind="item + \':\' + $position + \'|\'"></li>' + '</ul>')($rootScope); $rootScope.items = ['misko', 'shyam', 'doug']; $rootScope.$digest(); @@ -122,7 +122,7 @@ describe('ng:repeat', function() { inject(function($rootScope, $compile) { element = $compile( '<ul>' + - '<li ng:repeat="(key, val) in items" ng:bind="key + \':\' + val + \':\' + $position + \'|\'">' + + '<li ng-repeat="(key, val) in items" ng-bind="key + \':\' + val + \':\' + $position + \'|\'">' + '</li>' + '</ul>')($rootScope); $rootScope.items = {'misko':'m', 'shyam':'s', 'doug':'d', 'frodo':'f'}; @@ -137,7 +137,7 @@ describe('ng:repeat', function() { it('should ignore $ and $$ properties', inject(function($rootScope, $compile) { - element = $compile('<ul><li ng:repeat="i in items">{{i}}|</li></ul>')($rootScope); + element = $compile('<ul><li ng-repeat="i in items">{{i}}|</li></ul>')($rootScope); $rootScope.items = ['a', 'b', 'c']; $rootScope.items.$$hashkey = 'xxx'; $rootScope.items.$root = 'yyy'; @@ -150,8 +150,8 @@ describe('ng:repeat', function() { it('should repeat over nested arrays', inject(function($rootScope, $compile) { element = $compile( '<ul>' + - '<li ng:repeat="subgroup in groups">' + - '<div ng:repeat="group in subgroup">{{group}}|</div>X' + + '<li ng-repeat="subgroup in groups">' + + '<div ng-repeat="group in subgroup">{{group}}|</div>X' + '</li>' + '</ul>')($rootScope); $rootScope.groups = [['a', 'b'], ['c','d']]; @@ -163,7 +163,7 @@ describe('ng:repeat', function() { it('should ignore non-array element properties when iterating over an array', inject(function($rootScope, $compile) { - element = $compile('<ul><li ng:repeat="item in array">{{item}}|</li></ul>')($rootScope); + element = $compile('<ul><li ng-repeat="item in array">{{item}}|</li></ul>')($rootScope); $rootScope.array = ['a', 'b', 'c']; $rootScope.array.foo = '23'; $rootScope.array.bar = function() {}; @@ -175,7 +175,7 @@ describe('ng:repeat', function() { it('should iterate over non-existent elements of a sparse array', inject(function($rootScope, $compile) { - element = $compile('<ul><li ng:repeat="item in array">{{item}}|</li></ul>')($rootScope); + element = $compile('<ul><li ng-repeat="item in array">{{item}}|</li></ul>')($rootScope); $rootScope.array = ['a', 'b']; $rootScope.array[4] = 'c'; $rootScope.array[6] = 'd'; @@ -186,7 +186,7 @@ describe('ng:repeat', function() { it('should iterate over all kinds of types', inject(function($rootScope, $compile) { - element = $compile('<ul><li ng:repeat="item in array">{{item}}|</li></ul>')($rootScope); + element = $compile('<ul><li ng-repeat="item in array">{{item}}|</li></ul>')($rootScope); $rootScope.array = ['a', 1, null, undefined, {}]; $rootScope.$digest(); @@ -200,7 +200,7 @@ describe('ng:repeat', function() { beforeEach(inject(function($rootScope, $compile) { element = $compile( '<ul>' + - '<li ng:repeat="item in items" ng:bind="key + \':\' + val + \':\' + $position + \'|\'"></li>' + + '<li ng-repeat="item in items" ng-bind="key + \':\' + val + \':\' + $position + \'|\'"></li>' + '</ul>')($rootScope); a = {}; b = {}; diff --git a/test/directive/ngShowHideSpec.js b/test/directive/ngShowHideSpec.js index 6b9aea24..5005274d 100644 --- a/test/directive/ngShowHideSpec.js +++ b/test/directive/ngShowHideSpec.js @@ -1,6 +1,6 @@ 'use strict'; -describe('ng:show / ng:hide', function() { +describe('ng-show / ng-hide', function() { var element; @@ -8,9 +8,9 @@ describe('ng:show / ng:hide', function() { dealoc(element); }); - describe('ng:show', function() { + describe('ng-show', function() { it('should show and hide an element', inject(function($rootScope, $compile) { - element = jqLite('<div ng:show="exp"></div>'); + element = jqLite('<div ng-show="exp"></div>'); element = $compile(element)($rootScope); $rootScope.$digest(); expect(isCssVisible(element)).toEqual(false); @@ -21,7 +21,7 @@ describe('ng:show / ng:hide', function() { it('should make hidden element visible', inject(function($rootScope, $compile) { - element = jqLite('<div style="display: none" ng:show="exp"></div>'); + element = jqLite('<div style="display: none" ng-show="exp"></div>'); element = $compile(element)($rootScope); expect(isCssVisible(element)).toBe(false); $rootScope.exp = true; @@ -30,9 +30,9 @@ describe('ng:show / ng:hide', function() { })); }); - describe('ng:hide', function() { + describe('ng-hide', function() { it('should hide an element', inject(function($rootScope, $compile) { - element = jqLite('<div ng:hide="exp"></div>'); + element = jqLite('<div ng-hide="exp"></div>'); element = $compile(element)($rootScope); expect(isCssVisible(element)).toBe(true); $rootScope.exp = true; diff --git a/test/directive/ngStyleSpec.js b/test/directive/ngStyleSpec.js index a413353b..c12f2f4d 100644 --- a/test/directive/ngStyleSpec.js +++ b/test/directive/ngStyleSpec.js @@ -1,6 +1,6 @@ 'use strict'; -describe('ng:style', function() { +describe('ng-style', function() { var element; @@ -10,14 +10,14 @@ describe('ng:style', function() { it('should set', inject(function($rootScope, $compile) { - element = $compile('<div ng:style="{height: \'40px\'}"></div>')($rootScope); + element = $compile('<div ng-style="{height: \'40px\'}"></div>')($rootScope); $rootScope.$digest(); expect(element.css('height')).toEqual('40px'); })); it('should silently ignore undefined style', inject(function($rootScope, $compile) { - element = $compile('<div ng:style="myStyle"></div>')($rootScope); + element = $compile('<div ng-style="myStyle"></div>')($rootScope); $rootScope.$digest(); expect(element.hasClass('ng-exception')).toBeFalsy(); })); @@ -31,7 +31,7 @@ describe('ng:style', function() { preCompVal = '300px'; postCompStyle = 'height'; postCompVal = '100px'; - element = jqLite('<div ng:style="styleObj"></div>'); + element = jqLite('<div ng-style="styleObj"></div>'); element.css(preCompStyle, preCompVal); jqLite(document.body).append(element); $compile(element)($rootScope); diff --git a/test/directive/ngSwitchSpec.js b/test/directive/ngSwitchSpec.js index 88e81dea..c61dd60d 100644 --- a/test/directive/ngSwitchSpec.js +++ b/test/directive/ngSwitchSpec.js @@ -1,6 +1,6 @@ 'use strict'; -describe('ng:switch', function() { +describe('ng-switch', function() { var element; @@ -12,9 +12,9 @@ describe('ng:switch', function() { it('should switch on value change', inject(function($rootScope, $compile) { element = $compile( '<div ng-switch="select">' + - '<div ng:switch-when="1">first:{{name}}</div>' + - '<div ng:switch-when="2">second:{{name}}</div>' + - '<div ng:switch-when="true">true:{{name}}</div>' + + '<div ng-switch-when="1">first:{{name}}</div>' + + '<div ng-switch-when="2">second:{{name}}</div>' + + '<div ng-switch-when="true">true:{{name}}</div>' + '</div>')($rootScope); expect(element.html()).toEqual( '<!-- ngSwitchWhen: 1 --><!-- ngSwitchWhen: 2 --><!-- ngSwitchWhen: true -->'); @@ -53,7 +53,7 @@ describe('ng:switch', function() { it('should call change on switch', inject(function($rootScope, $compile) { element = $compile( '<ng:switch on="url" change="name=\'works\'">' + - '<div ng:switch-when="a">{{name}}</div>' + + '<div ng-switch-when="a">{{name}}</div>' + '</ng:switch>')($rootScope); $rootScope.url = 'a'; $rootScope.$apply(); diff --git a/test/directive/ngViewSpec.js b/test/directive/ngViewSpec.js index afdded94..2a4347a0 100644 --- a/test/directive/ngViewSpec.js +++ b/test/directive/ngViewSpec.js @@ -1,6 +1,6 @@ 'use strict'; -describe('ng:view', function() { +describe('ng-view', function() { var element; beforeEach(module(function() { @@ -118,7 +118,7 @@ describe('ng:view', function() { }); - it('should be possible to nest ng:view in ng:include', inject(function() { + it('should be possible to nest ng-view in ng-include', inject(function() { // TODO(vojta): refactor this test dealoc(element); var injector = angular.injector(['ng', 'ngMock', function($routeProvider) { @@ -149,7 +149,7 @@ describe('ng:view', function() { it('should initialize view template after the view controller was initialized even when ' + 'templates were cached', function() { - //this is a test for a regression that was introduced by making the ng:view cache sync + //this is a test for a regression that was introduced by making the ng-view cache sync function ParentCtrl($scope) { $scope.log.push('parent'); } @@ -168,8 +168,8 @@ describe('ng:view', function() { $location.path('/foo'); $httpBackend.expect('GET', 'viewPartial.html'). - respond('<div ng:init="log.push(\'init\')">' + - '<div ng:controller="ChildCtrl"></div>' + + respond('<div ng-init="log.push(\'init\')">' + + '<div ng-controller="ChildCtrl"></div>' + '</div>'); $rootScope.$apply(); $httpBackend.flush(); diff --git a/test/directive/selectSpec.js b/test/directive/selectSpec.js index c262d0cf..3b4f992e 100644 --- a/test/directive/selectSpec.js +++ b/test/directive/selectSpec.js @@ -23,7 +23,7 @@ describe('select', function() { describe('select-one', function() { - it('should compile children of a select without a ng:model, but not create a model for it', + it('should compile children of a select without a ng-model, but not create a model for it', function() { compile('<select>' + '<option selected="true">{{a}}</option>' + @@ -41,7 +41,7 @@ describe('select', function() { it('should require', function() { compile( - '<select name="select" ng:model="selection" required ng:change="change()">' + + '<select name="select" ng-model="selection" required ng-change="change()">' + '<option value=""></option>' + '<option value="c">C</option>' + '</select>'); @@ -78,7 +78,7 @@ describe('select', function() { it('should not be invalid if no require', function() { compile( - '<select name="select" ng:model="selection">' + + '<select name="select" ng-model="selection">' + '<option value=""></option>' + '<option value="c">C</option>' + '</select>'); @@ -93,7 +93,7 @@ describe('select', function() { it('should support type="select-multiple"', function() { compile( - '<select ng:model="selection" multiple>' + + '<select ng-model="selection" multiple>' + '<option>A</option>' + '<option>B</option>' + '</select>'); @@ -108,7 +108,7 @@ describe('select', function() { it('should require', function() { compile( - '<select name="select" ng:model="selection" multiple required>' + + '<select name="select" ng-model="selection" multiple required>' + '<option>A</option>' + '<option>B</option>' + '</select>'); @@ -136,7 +136,7 @@ describe('select', function() { }); - describe('ng:options', function() { + describe('ng-options', function() { function createSelect(attrs, blank, unknown) { var html = '<select'; forEach(attrs, function(value, key) { @@ -156,24 +156,24 @@ describe('select', function() { function createSingleSelect(blank, unknown) { createSelect({ - 'ng:model':'selected', - 'ng:options':'value.name for value in values' + 'ng-model':'selected', + 'ng-options':'value.name for value in values' }, blank, unknown); } function createMultiSelect(blank, unknown) { createSelect({ - 'ng:model':'selected', + 'ng-model':'selected', 'multiple':true, - 'ng:options':'value.name for value in values' + 'ng-options':'value.name for value in values' }, blank, unknown); } it('should throw when not formated "? for ? in ?"', function() { expect(function() { - compile('<select ng:model="selected" ng:options="i dont parse"></select>'); - }).toThrow("Expected ng:options in form of '_select_ (as _label_)? for (_key_,)?_value_ in" + + compile('<select ng-model="selected" ng-options="i dont parse"></select>'); + }).toThrow("Expected ng-options in form of '_select_ (as _label_)? for (_key_,)?_value_ in" + " _collection_' but got 'i dont parse'."); }); @@ -196,8 +196,8 @@ describe('select', function() { it('should render an object', function() { createSelect({ - 'ng:model': 'selected', - 'ng:options': 'value as key for (key, value) in object' + 'ng-model': 'selected', + 'ng-options': 'value as key for (key, value) in object' }); scope.$apply(function() { @@ -380,8 +380,8 @@ describe('select', function() { it('should bind to scope value and group', function() { createSelect({ - 'ng:model': 'selected', - 'ng:options': 'item.name group by item.group for item in values' + 'ng-model': 'selected', + 'ng-options': 'item.name group by item.group for item in values' }); scope.$apply(function() { @@ -419,8 +419,8 @@ describe('select', function() { it('should bind to scope value through experession', function() { createSelect({ - 'ng:model': 'selected', - 'ng:options': 'item.id as item.name for item in values' + 'ng-model': 'selected', + 'ng-options': 'item.id as item.name for item in values' }); scope.$apply(function() { @@ -440,8 +440,8 @@ describe('select', function() { it('should bind to object key', function() { createSelect({ - 'ng:model': 'selected', - 'ng:options': 'key as value for (key, value) in object' + 'ng-model': 'selected', + 'ng-options': 'key as value for (key, value) in object' }); scope.$apply(function() { @@ -461,8 +461,8 @@ describe('select', function() { it('should bind to object value', function() { createSelect({ - 'ng:model': 'selected', - 'ng:options': 'value as key for (key, value) in object' + 'ng-model': 'selected', + 'ng-options': 'value as key for (key, value) in object' }); scope.$apply(function() { @@ -592,9 +592,9 @@ describe('select', function() { }); - it('should support binding via ng:bind-template attribute', function () { + it('should support binding via ng-bind-template attribute', function () { var option; - createSingleSelect('<option value="" ng:bind-template="blank is {{blankVal}}"></option>'); + createSingleSelect('<option value="" ng-bind-template="blank is {{blankVal}}"></option>'); scope.$apply(function() { scope.blankVal = 'so blank'; @@ -609,9 +609,9 @@ describe('select', function() { }); - it('should support biding via ng:bind attribute', function () { + it('should support biding via ng-bind attribute', function () { var option; - createSingleSelect('<option value="" ng:bind="blankVal"></option>'); + createSingleSelect('<option value="" ng-bind="blankVal"></option>'); scope.$apply(function() { scope.blankVal = 'is blank'; @@ -664,8 +664,8 @@ describe('select', function() { it('should update model on change through expression', function() { createSelect({ - 'ng:model': 'selected', - 'ng:options': 'item.id as item.name for item in values' + 'ng-model': 'selected', + 'ng-options': 'item.id as item.name for item in values' }); scope.$apply(function() { @@ -745,9 +745,9 @@ describe('select', function() { it('should select from object', function() { createSelect({ - 'ng:model':'selected', + 'ng-model':'selected', 'multiple':true, - 'ng:options':'key as value for (key,value) in values' + 'ng-options':'key as value for (key,value) in values' }); scope.values = {'0':'A', '1':'B'}; @@ -766,13 +766,13 @@ describe('select', function() { }); - describe('ng:required', function() { + describe('ng-required', function() { - it('should allow bindings on ng:required', function() { + it('should allow bindings on ng-required', function() { createSelect({ - 'ng:model': 'value', - 'ng:options': 'item.name for item in values', - 'ng:required': '{{required}}' + 'ng-model': 'value', + 'ng-options': 'item.name for item in values', + 'ng-required': '{{required}}' }, true); @@ -831,24 +831,24 @@ describe('select', function() { it('should populate value attribute on OPTION', inject(function($rootScope, $compile) { - element = $compile('<select ng:model="x"><option>abc</option></select>')($rootScope) + element = $compile('<select ng-model="x"><option>abc</option></select>')($rootScope) expect(element).toHaveValue('abc'); })); it('should ignore value if already exists', inject(function($rootScope, $compile) { - element = $compile('<select ng:model="x"><option value="abc">xyz</option></select>')($rootScope) + element = $compile('<select ng-model="x"><option value="abc">xyz</option></select>')($rootScope) expect(element).toHaveValue('abc'); })); it('should set value even if newlines present', inject(function($rootScope, $compile) { - element = $compile('<select ng:model="x"><option attr="\ntext\n" \n>\nabc\n</option></select>')($rootScope) + element = $compile('<select ng-model="x"><option attr="\ntext\n" \n>\nabc\n</option></select>')($rootScope) expect(element).toHaveValue('\nabc\n'); })); it('should set value even if self closing HTML', inject(function($rootScope, $compile) { // IE removes the \n from option, which makes this test pointless if (msie) return; - element = $compile('<select ng:model="x"><option>\n</option></select>')($rootScope) + element = $compile('<select ng-model="x"><option>\n</option></select>')($rootScope) expect(element).toHaveValue('\n'); })); }); |
