Correctly check that the value of data is nil
The way we access "data" always returned nil
This commit is contained in:
@@ -3,7 +3,7 @@ require "rails_helper"
|
|||||||
# Useful resource: http://graphql.org/learn/serving-over-http/
|
# Useful resource: http://graphql.org/learn/serving-over-http/
|
||||||
|
|
||||||
def parser_error_raised?(response)
|
def parser_error_raised?(response)
|
||||||
data_is_empty = response["data"].nil?
|
data_is_empty = response.parsed_body["data"].nil?
|
||||||
error_is_present = (JSON.parse(response.body)["errors"].first["message"] =~ /^Parse error on/)
|
error_is_present = (JSON.parse(response.body)["errors"].first["message"] =~ /^Parse error on/)
|
||||||
data_is_empty && error_is_present
|
data_is_empty && error_is_present
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user