Permalink
Browse files

Spec for a query that raises a GraphQL::ParseError.

  • Loading branch information...
dblock committed Oct 31, 2017
1 parent 9c121a3 commit d42b62380f87cc41b7c1838089fd46ca3b7d238c
Showing with 18 additions and 0 deletions.
  1. +18 −0 spec/graphql/queries/invalid_query_spec.rb
@@ -0,0 +1,18 @@
require 'rails_helper'
describe 'Invalid Query', type: :request do
include_context 'GraphQL Client'
let(:query) do
<<-GRAPHQL
whatever {
}
GRAPHQL
end
it 'raises an execution error' do
expect do
client.execute(query)
end.to raise_error GraphQL::ParseError, /Parse error on "whatever"/
end
end

0 comments on commit d42b623

Please sign in to comment.