@@ -108,12 +108,11 @@ def get_page_info(result, key = "bases")
108108 result = star_wars_query ( query_string , { "after" => first_cursor , "first" => 2 } )
109109 assert_equal ( [ "Y-Wing" , "A-Wing" ] , get_names ( result ) )
110110
111- # After the last result, find the next 2:
112- second_cursor = get_last_cursor ( result )
111+ third_cursor = get_last_cursor ( result )
113112
114- # There is only 2 results between the cursors
115- result = star_wars_query ( query_string , { "after" => first_cursor , "before" => second_cursor , "first" => 5 } )
116- assert_equal ( [ "Y-Wing" , "A-Wing" ] , get_names ( result ) )
113+ # There is only 1 result between the cursors
114+ result = star_wars_query ( query_string , { "after" => first_cursor , "before" => third_cursor , "first" => 5 } )
115+ assert_equal ( [ "Y-Wing" ] , get_names ( result ) )
117116 end
118117
119118 it 'handles cursors beyond the bounds of the array' do
@@ -175,7 +174,7 @@ def get_names(result)
175174 # Max page size is applied _without_ `first`, also
176175 result = star_wars_query ( query_string )
177176 assert_equal ( [ "Yavin" , "Echo Base" ] , get_names ( result ) )
178- assert_equal ( true , get_page_info ( result ) [ "hasNextPage" ] , "hasNextPage is true when first is not specified" )
177+ assert_equal ( false , get_page_info ( result ) [ "hasNextPage" ] , "hasNextPage is false when first is not specified" )
179178 end
180179
181180 it "applies to queries by `last`" do
@@ -235,7 +234,7 @@ def get_page_info(result)
235234 # Max page size is applied _without_ `first`, also
236235 result = star_wars_query ( query_string )
237236 assert_equal ( [ "Yavin" , "Echo Base" , "Secret Hideout" ] , get_names ( result ) )
238- assert_equal ( true , get_page_info ( result ) [ "hasNextPage" ] , "hasNextPage is true when first is not specified" )
237+ assert_equal ( false , get_page_info ( result ) [ "hasNextPage" ] , "hasNextPage is false when first is not specified" )
239238 end
240239
241240 it "applies to queries by `last`" do
0 commit comments