Skip to content

Commit fa67968

Browse files
committed
Add a couple erroring tests
> ArgumentError: invalid base64
1 parent 62f7c4a commit fa67968

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

spec/integration/rails/graphql/relay/array_connection_spec.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,5 +286,20 @@ def get_page_info(result)
286286
assert_equal(first_second_and_third_names, get_names(result))
287287
end
288288
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
289304
end
290305
end

0 commit comments

Comments
 (0)