@@ -124,6 +124,8 @@ QUnit.test('The registry normalizes names when checking if the factory is regist
124124} ) ;
125125
126126QUnit . test ( 'validateFullName throws an error if name is incorrect' , function ( ) {
127+ expect ( 2 ) ;
128+
127129 var registry = new Registry ( ) ;
128130 var PostController = factory ( ) ;
129131
@@ -133,8 +135,12 @@ QUnit.test('validateFullName throws an error if name is incorrect', function() {
133135
134136 registry . register ( 'controller:post' , PostController ) ;
135137 throws ( function ( ) {
136- registry . resolve ( 'post' ) ;
138+ registry . validateFullName ( 'post' ) ;
137139 } , / T y p e E r r o r : I n v a l i d F u l l n a m e , e x p e c t e d : ` t y p e : n a m e ` g o t : p o s t / ) ;
140+
141+ throws ( function ( ) {
142+ registry . validateFullName ( 'route:http://foo.bar.com/baz' ) ;
143+ } , / T y p e E r r o r : I n v a l i d F u l l n a m e , e x p e c t e d : ` t y p e : n a m e ` g o t : r o u t e : h t t p : \/ \/ f o o .b a r .c o m \/ b a z / ) ;
138144} ) ;
139145
140146QUnit . test ( 'The registry normalizes names when injecting' , function ( ) {
@@ -205,6 +211,14 @@ QUnit.test('registry.has should not accidentally cause injections on that factor
205211 ok ( registry . has ( 'controller:apple' ) ) ;
206212} ) ;
207213
214+ QUnit . test ( 'registry.has should not error for invalid fullNames)' , function ( ) {
215+ expect ( 1 ) ;
216+
217+ var registry = new Registry ( ) ;
218+
219+ ok ( ! registry . has ( 'foo:bar:baz' ) ) ;
220+ } ) ;
221+
208222QUnit . test ( 'once resolved, always return the same result' , function ( ) {
209223 expect ( 1 ) ;
210224
0 commit comments