@@ -149,6 +149,77 @@ describe('Blueprint: route', function () {
149
149
} ) ;
150
150
} ) ;
151
151
152
+ it ( 'route foo --route-authoring-format strict' , function ( ) {
153
+ return emberGenerateDestroy (
154
+ [ 'route' , 'foo' , '--route-authoring-format' , 'strict' ] ,
155
+ ( _file ) => {
156
+ expect ( _file ( 'app/routes/foo.js' ) ) . to . equal ( fixture ( 'route/route.js' ) ) ;
157
+
158
+ expect ( _file ( 'app/templates/foo.gjs' ) ) . to . equal (
159
+ fixture ( 'route/strict-route-template.gjs' )
160
+ ) ;
161
+ expect ( _file ( 'app/templates/foo.hbs' ) ) . to . not . exist ;
162
+
163
+ expect ( _file ( 'tests/unit/routes/foo-test.js' ) ) . to . equal ( fixture ( 'route-test/app.js' ) ) ;
164
+
165
+ expect ( file ( 'app/router.js' ) ) . to . contain ( "this.route('foo')" ) ;
166
+ }
167
+ ) ;
168
+ } ) ;
169
+
170
+ it ( 'route foo --strict' , function ( ) {
171
+ return emberGenerateDestroy ( [ 'route' , 'foo' , '--strict' ] , ( _file ) => {
172
+ expect ( _file ( 'app/routes/foo.js' ) ) . to . equal ( fixture ( 'route/route.js' ) ) ;
173
+
174
+ expect ( _file ( 'app/templates/foo.gjs' ) ) . to . equal ( fixture ( 'route/strict-route-template.gjs' ) ) ;
175
+ expect ( _file ( 'app/templates/foo.hbs' ) ) . to . not . exist ;
176
+
177
+ expect ( _file ( 'tests/unit/routes/foo-test.js' ) ) . to . equal ( fixture ( 'route-test/app.js' ) ) ;
178
+
179
+ expect ( file ( 'app/router.js' ) ) . to . contain ( "this.route('foo')" ) ;
180
+ } ) ;
181
+ } ) ;
182
+
183
+ it ( 'route foo --strict --typescript' , function ( ) {
184
+ return emberGenerateDestroy ( [ 'route' , 'foo' , '--strict' , '--typescript' ] , ( _file ) => {
185
+ expect ( _file ( 'app/routes/foo.ts' ) ) . to . equal ( fixture ( 'route/route.js' ) ) ;
186
+
187
+ expect ( _file ( 'app/templates/foo.gts' ) ) . to . equal ( fixture ( 'route/strict-route-template.gts' ) ) ;
188
+ expect ( _file ( 'app/templates/foo.hbs' ) ) . to . not . exist ;
189
+
190
+ expect ( _file ( 'tests/unit/routes/foo-test.ts' ) ) . to . equal ( fixture ( 'route-test/app.js' ) ) ;
191
+
192
+ expect ( file ( 'app/router.js' ) ) . to . contain ( "this.route('foo')" ) ;
193
+ } ) ;
194
+ } ) ;
195
+
196
+ it ( 'route foo --route-authoring-format loose' , function ( ) {
197
+ return emberGenerateDestroy (
198
+ [ 'route' , 'foo' , '--route-authoring-format' , 'loose' ] ,
199
+ ( _file ) => {
200
+ expect ( _file ( 'app/routes/foo.js' ) ) . to . equal ( fixture ( 'route/route.js' ) ) ;
201
+
202
+ expect ( _file ( 'app/templates/foo.hbs' ) ) . to . equal ( '{{page-title "Foo"}}\n{{outlet}}' ) ;
203
+
204
+ expect ( _file ( 'tests/unit/routes/foo-test.js' ) ) . to . equal ( fixture ( 'route-test/app.js' ) ) ;
205
+
206
+ expect ( file ( 'app/router.js' ) ) . to . contain ( "this.route('foo')" ) ;
207
+ }
208
+ ) ;
209
+ } ) ;
210
+
211
+ it ( 'route foo --loose' , function ( ) {
212
+ return emberGenerateDestroy ( [ 'route' , 'foo' , '--loose' ] , ( _file ) => {
213
+ expect ( _file ( 'app/routes/foo.js' ) ) . to . equal ( fixture ( 'route/route.js' ) ) ;
214
+
215
+ expect ( _file ( 'app/templates/foo.hbs' ) ) . to . equal ( '{{page-title "Foo"}}\n{{outlet}}' ) ;
216
+
217
+ expect ( _file ( 'tests/unit/routes/foo-test.js' ) ) . to . equal ( fixture ( 'route-test/app.js' ) ) ;
218
+
219
+ expect ( file ( 'app/router.js' ) ) . to . contain ( "this.route('foo')" ) ;
220
+ } ) ;
221
+ } ) ;
222
+
152
223
it ( 'route foo --pod' , function ( ) {
153
224
return emberGenerateDestroy ( [ 'route' , 'foo' , '--pod' ] , ( _file ) => {
154
225
expect ( _file ( 'app/foo.js/route.js' ) ) . to . not . exist ;
0 commit comments