@@ -103,20 +103,36 @@ describe('accordion', function () {
103
103
} ) ;
104
104
105
105
describe ( 'accordion' , function ( ) {
106
- var scope , $compile , element ;
106
+ var scope , $compile , $templateCache , element ;
107
107
108
- beforeEach ( inject ( function ( $rootScope , _$compile_ ) {
108
+ beforeEach ( inject ( function ( $rootScope , _$compile_ , _$templateCache_ ) {
109
109
scope = $rootScope ;
110
110
$compile = _$compile_ ;
111
+ $templateCache = _$templateCache_ ;
111
112
} ) ) ;
112
113
113
- it ( 'should allow custom templates' , inject ( function ( $templateCache ) {
114
+ it ( 'should expose the controller on the view' , function ( ) {
115
+ $templateCache . put ( 'template/accordion/accordion.html' , '<div>{{accordion.text}}</div>' ) ;
116
+
117
+ element = $compile ( '<accordion></accordion' ) ( scope ) ;
118
+ scope . $digest ( ) ;
119
+
120
+ var ctrl = element . controller ( 'accordion' ) ;
121
+ expect ( ctrl ) . toBeDefined ( ) ;
122
+
123
+ ctrl . text = 'foo' ;
124
+ scope . $digest ( ) ;
125
+
126
+ expect ( element . html ( ) ) . toBe ( '<div class="ng-binding">foo</div>' ) ;
127
+ } ) ;
128
+
129
+ it ( 'should allow custom templates' , function ( ) {
114
130
$templateCache . put ( 'foo/bar.html' , '<div>baz</div>' ) ;
115
131
116
132
element = $compile ( '<accordion template-url="foo/bar.html"></accordion>' ) ( scope ) ;
117
133
scope . $digest ( ) ;
118
134
expect ( element . html ( ) ) . toBe ( '<div>baz</div>' ) ;
119
- } ) ) ;
135
+ } ) ;
120
136
} ) ;
121
137
122
138
describe ( 'accordion-group' , function ( ) {
0 commit comments