Skip to content

Commit

Permalink
Spec for a query that raises a GraphQL::ParseError.
Browse files Browse the repository at this point in the history
  • Loading branch information
dblock committed Oct 31, 2017
1 parent 9c121a3 commit d42b623
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions spec/graphql/queries/invalid_query_spec.rb
Original file line number Original file line Diff line number Diff line change
@@ -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.