File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
spec/integration/rails/graphql/relay Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -286,5 +286,20 @@ def get_page_info(result)
286
286
assert_equal ( first_second_and_third_names , get_names ( result ) )
287
287
end
288
288
end
289
+
290
+ it "raises an execution error when an invalid 'after' cursor is given" do
291
+ res = star_wars_query ( query_string , "after" => "0" )
292
+ errors = res [ "errors" ]
293
+ assert_equal 3 , errors . size , "should have some query errors"
294
+ assert_equal [ "Invalid cursor '0'" ] , errors . map { |error | error [ "message" ] } . uniq
295
+ end
296
+
297
+ it "raises an execution error when an invalid 'before' cursor is given" do
298
+ res = star_wars_query ( query_string , "before" => "something something" )
299
+ errors = res [ "errors" ]
300
+ assert_equal 3 , errors . size , "should have some query errors"
301
+ assert_equal [ "Invalid cursor 'something something'" ] ,
302
+ errors . map { |error | error [ "message" ] } . uniq
303
+ end
289
304
end
290
305
end
You can’t perform that action at this time.
0 commit comments