From 630c6de96763b54fff5a98401a251eefbb6eeced Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Tue, 7 Jan 2020 17:27:00 +0100 Subject: [PATCH] specs: move the query for individual to the individual context --- .../api/v2/graphql_controller_spec.rb | 114 +++++++++--------- 1 file changed, 57 insertions(+), 57 deletions(-) diff --git a/spec/controllers/api/v2/graphql_controller_spec.rb b/spec/controllers/api/v2/graphql_controller_spec.rb index dc5176980..1b6d009eb 100644 --- a/spec/controllers/api/v2/graphql_controller_spec.rb +++ b/spec/controllers/api/v2/graphql_controller_spec.rb @@ -169,71 +169,71 @@ describe API::V2::GraphqlController do end context "dossier" do - let(:query) do - "{ - dossier(number: #{dossier.id}) { - id - number - state - dateDerniereModification - datePassageEnConstruction - datePassageEnInstruction - dateTraitement - motivation - motivationAttachment { - url - } - usager { + context "with individual" do + let(:query) do + "{ + dossier(number: #{dossier.id}) { id - email - } - demandeur { - id - ... on PersonnePhysique { - nom - prenom - civilite - dateDeNaissance - } - } - instructeurs { - id - email - } - messages { - email - body - attachment { - filename - checksum - byteSize - contentType + number + state + dateDerniereModification + datePassageEnConstruction + datePassageEnInstruction + dateTraitement + motivation + motivationAttachment { url } - } - avis { - expert { + usager { + id email } - question - reponse - dateQuestion - dateReponse - attachment { - url - filename + demandeur { + id + ... on PersonnePhysique { + nom + prenom + civilite + dateDeNaissance + } + } + instructeurs { + id + email + } + messages { + email + body + attachment { + filename + checksum + byteSize + contentType + url + } + } + avis { + expert { + email + } + question + reponse + dateQuestion + dateReponse + attachment { + url + filename + } + } + champs { + id + label + stringValue } } - champs { - id - label - stringValue - } - } - }" - end + }" + end - context "with individual" do it "should be returned" do expect(gql_errors).to eq(nil) expect(gql_data).to eq(dossier: {