@@ -239,13 +239,49 @@ QUnit.test("should not throw deprecations if {{outlet}} is used with a quoted na
239
239
runAppend ( top ) ;
240
240
} ) ;
241
241
242
- QUnit . test ( "should throw an assertion if {{outlet}} used with unquoted name" , function ( ) {
243
- top . setOutletState ( withTemplate ( "{{outlet foo}}" ) ) ;
244
- expectAssertion ( function ( ) {
245
- runAppend ( top ) ;
246
- } , "Using {{outlet}} with an unquoted name is not supported." ) ;
242
+ QUnit . test ( "{{outlet}} should work with an unquoted name" , function ( ) {
243
+ var routerState = {
244
+ render : {
245
+ controller : Ember . Controller . create ( {
246
+ outletName : 'magical'
247
+ } ) ,
248
+ template : compile ( '{{outlet outletName}}' )
249
+ } ,
250
+ outlets : {
251
+ magical : withTemplate ( "It's magic" )
252
+ }
253
+ } ;
254
+
255
+ top . setOutletState ( routerState ) ;
256
+ runAppend ( top ) ;
257
+
258
+ equal ( top . $ ( ) . text ( ) . trim ( ) , "It's magic" ) ;
247
259
} ) ;
248
260
261
+ QUnit . test ( "{{outlet}} should rerender when bound name changes" , function ( ) {
262
+ var routerState = {
263
+ render : {
264
+ controller : Ember . Controller . create ( {
265
+ outletName : 'magical'
266
+ } ) ,
267
+ template : compile ( '{{outlet outletName}}' )
268
+ } ,
269
+ outlets : {
270
+ magical : withTemplate ( "It's magic" ) ,
271
+ second : withTemplate ( "second" )
272
+ }
273
+ } ;
274
+
275
+ top . setOutletState ( routerState ) ;
276
+ runAppend ( top ) ;
277
+ equal ( top . $ ( ) . text ( ) . trim ( ) , "It's magic" ) ;
278
+ run ( function ( ) {
279
+ routerState . render . controller . set ( 'outletName' , 'second' ) ;
280
+ } ) ;
281
+ equal ( top . $ ( ) . text ( ) . trim ( ) , "second" ) ;
282
+ } ) ;
283
+
284
+
249
285
function withTemplate ( string ) {
250
286
return {
251
287
render : {
0 commit comments