1
1
require ( './helper' ) ;
2
- var Route = require ( '../modules/Route' ) ;
3
2
var ActiveStore = require ( '../modules/stores/ActiveStore' ) ;
3
+ var Route = require ( '../modules/components/Route' ) ;
4
4
5
5
var App = React . createClass ( {
6
6
displayName : 'App' ,
@@ -10,14 +10,15 @@ var App = React.createClass({
10
10
} ) ;
11
11
12
12
describe ( 'when a Route is active' , function ( ) {
13
+ var route ;
13
14
beforeEach ( function ( ) {
14
- Route . clearNamedRoutes ( ) ;
15
+ route = Route ( { name : 'products' , handler : App } ) ;
15
16
} ) ;
16
17
17
18
describe ( 'and it has no params' , function ( ) {
18
19
beforeEach ( function ( ) {
19
20
ActiveStore . update ( {
20
- routes : [ new Route ( { name : 'products' , handler : App } ) ]
21
+ activeRoutes : [ route ]
21
22
} ) ;
22
23
} ) ;
23
24
@@ -29,9 +30,9 @@ describe('when a Route is active', function () {
29
30
describe ( 'and the right params are given' , function ( ) {
30
31
beforeEach ( function ( ) {
31
32
ActiveStore . update ( {
32
- routes : [ new Route ( { name : 'products' , handler : App } ) ] ,
33
- params : { id : '123' , show : 'true' } ,
34
- query : { search : 'abc' }
33
+ activeRoutes : [ route ] ,
34
+ activeParams : { id : '123' , show : 'true' } ,
35
+ activeQuery : { search : 'abc' }
35
36
} ) ;
36
37
} ) ;
37
38
@@ -57,8 +58,8 @@ describe('when a Route is active', function () {
57
58
describe ( 'and the wrong params are given' , function ( ) {
58
59
beforeEach ( function ( ) {
59
60
ActiveStore . update ( {
60
- routes : [ new Route ( { name : 'products' , handler : App } ) ] ,
61
- params : { id : 123 }
61
+ activeRoutes : [ route ] ,
62
+ activeParams : { id : 123 }
62
63
} ) ;
63
64
} ) ;
64
65
0 commit comments