From 62e85df83bb9f6328d6c826566e409efab58ddd7 Mon Sep 17 00:00:00 2001 From: taitus Date: Wed, 30 Oct 2024 14:03:16 +0100 Subject: [PATCH] Correctly check that the value of data is nil The way we access "data" always returned nil --- spec/controllers/graphql_controller_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/controllers/graphql_controller_spec.rb b/spec/controllers/graphql_controller_spec.rb index eeed8c578..a2765bd8a 100644 --- a/spec/controllers/graphql_controller_spec.rb +++ b/spec/controllers/graphql_controller_spec.rb @@ -3,7 +3,7 @@ require "rails_helper" # Useful resource: http://graphql.org/learn/serving-over-http/ 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/) data_is_empty && error_is_present end