@@ -76,7 +76,7 @@ describe('Example App', function() {
7676 . end ( done ) ;
7777 } ) ;
7878
79- it ( 'returns palces with any of the following tags' , function ( done ) {
79+ it ( 'returns places with any of the following tags' , function ( done ) {
8080 app . get ( url + '?tags[]=Båt&tags[]=Stekeovn' )
8181 . expect ( 200 )
8282 . expect ( function ( res ) {
@@ -87,4 +87,44 @@ describe('Example App', function() {
8787 } )
8888 . end ( done ) ;
8989 } ) ;
90+
91+ it ( 'returns places with visits less than 40' , function ( done ) {
92+ app . get ( url + '?visits=<40' )
93+ . expect ( 200 )
94+ . expect ( function ( res ) {
95+ assert . equal ( res . body . length , 0 ) ;
96+ } )
97+ . end ( done ) ;
98+ } ) ;
99+
100+ it ( 'returns places with visits less than or equal to 40' , function ( done ) {
101+ app . get ( url + '?visits=<=40' )
102+ . expect ( 200 )
103+ . expect ( function ( res ) {
104+ assert . equal ( res . body . length , 1 ) ;
105+ assert . equal ( res . body [ 0 ] . name , 'Solrenningen' ) ;
106+ } )
107+ . end ( done ) ;
108+ } ) ;
109+
110+ it ( 'returns places with visits greater than 10,000' , function ( done ) {
111+ app . get ( url + '?visits=>10000' )
112+ . expect ( 200 )
113+ . expect ( function ( res ) {
114+ assert . equal ( res . body . length , 1 ) ;
115+ assert . equal ( res . body [ 0 ] . name , 'Vardadalsbu' ) ;
116+ } )
117+ . end ( done ) ;
118+ } ) ;
119+
120+ it ( 'returns places with visits > or equal to 10,000' , function ( done ) {
121+ app . get ( url + '?visits=>=10000' )
122+ . expect ( 200 )
123+ . expect ( function ( res ) {
124+ assert . equal ( res . body . length , 2 ) ;
125+ assert . equal ( res . body [ 0 ] . name , 'Åsedalen' ) ;
126+ assert . equal ( res . body [ 1 ] . name , 'Vardadalsbu' ) ;
127+ } )
128+ . end ( done ) ;
129+ } ) ;
90130} ) ;
0 commit comments