diff options
| author | Misko Hevery | 2011-09-08 13:56:29 -0700 | 
|---|---|---|
| committer | Igor Minar | 2011-10-11 11:01:45 -0700 | 
| commit | 4f78fd692c0ec51241476e6be9a4df06cd62fdd6 (patch) | |
| tree | 91f70bb89b9c095126fbc093f51cedbac5cb0c78 /test/markupSpec.js | |
| parent | df6d2ba3266de405ad6c2f270f24569355706e76 (diff) | |
| download | angular.js-4f78fd692c0ec51241476e6be9a4df06cd62fdd6.tar.bz2 | |
feat(forms): new and improved forms
Diffstat (limited to 'test/markupSpec.js')
| -rw-r--r-- | test/markupSpec.js | 20 | 
1 files changed, 13 insertions, 7 deletions
| diff --git a/test/markupSpec.js b/test/markupSpec.js index 2704e0dc..bd77c058 100644 --- a/test/markupSpec.js +++ b/test/markupSpec.js @@ -26,12 +26,18 @@ describe("markups", function(){    });    it('should translate {{}} in terminal nodes', function(){ -    compile('<select name="x"><option value="">Greet {{name}}!</option></select>'); +    compile('<select ng:model="x"><option value="">Greet {{name}}!</option></select>');      scope.$digest(); -    expect(sortedHtml(element).replace(' selected="true"', '')).toEqual('<select name="x"><option ng:bind-template="Greet {{name}}!">Greet !</option></select>'); +    expect(sortedHtml(element).replace(' selected="true"', '')). +      toEqual('<select ng:model="x">' + +                '<option ng:bind-template="Greet {{name}}!">Greet !</option>' + +              '</select>');      scope.name = 'Misko';      scope.$digest(); -    expect(sortedHtml(element).replace(' selected="true"', '')).toEqual('<select name="x"><option ng:bind-template="Greet {{name}}!">Greet Misko!</option></select>'); +    expect(sortedHtml(element).replace(' selected="true"', '')). +      toEqual('<select ng:model="x">' + +                '<option ng:bind-template="Greet {{name}}!">Greet Misko!</option>' + +              '</select>');    });    it('should translate {{}} in attributes', function(){ @@ -69,24 +75,24 @@ describe("markups", function(){      it('should populate value attribute on OPTION', function(){ -      compile('<select name="x"><option>abc</option></select>'); +      compile('<select ng:model="x"><option>abc</option></select>');        expect(element).toHaveValue('abc');      });      it('should ignore value if already exists', function(){ -      compile('<select name="x"><option value="abc">xyz</option></select>'); +      compile('<select ng:model="x"><option value="abc">xyz</option></select>');        expect(element).toHaveValue('abc');      });      it('should set value even if newlines present', function(){ -      compile('<select name="x"><option attr="\ntext\n" \n>\nabc\n</option></select>'); +      compile('<select ng:model="x"><option attr="\ntext\n" \n>\nabc\n</option></select>');        expect(element).toHaveValue('\nabc\n');      });      it('should set value even if self closing HTML', function(){        // IE removes the \n from option, which makes this test pointless        if (msie) return; -      compile('<select name="x"><option>\n</option></select>'); +      compile('<select ng:model="x"><option>\n</option></select>');        expect(element).toHaveValue('\n');      }); | 
