specs: move the query for individual to the individual context

This commit is contained in:
Pierre de La Morinerie 2020-01-07 17:27:00 +01:00
parent 4cec26f73a
commit 630c6de967

View file

@ -169,71 +169,71 @@ describe API::V2::GraphqlController do
end end
context "dossier" do context "dossier" do
let(:query) do context "with individual" do
"{ let(:query) do
dossier(number: #{dossier.id}) { "{
id dossier(number: #{dossier.id}) {
number
state
dateDerniereModification
datePassageEnConstruction
datePassageEnInstruction
dateTraitement
motivation
motivationAttachment {
url
}
usager {
id id
email number
} state
demandeur { dateDerniereModification
id datePassageEnConstruction
... on PersonnePhysique { datePassageEnInstruction
nom dateTraitement
prenom motivation
civilite motivationAttachment {
dateDeNaissance
}
}
instructeurs {
id
email
}
messages {
email
body
attachment {
filename
checksum
byteSize
contentType
url url
} }
} usager {
avis { id
expert {
email email
} }
question demandeur {
reponse id
dateQuestion ... on PersonnePhysique {
dateReponse nom
attachment { prenom
url civilite
filename 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 end
label
stringValue
}
}
}"
end
context "with individual" do
it "should be returned" do it "should be returned" do
expect(gql_errors).to eq(nil) expect(gql_errors).to eq(nil)
expect(gql_data).to eq(dossier: { expect(gql_data).to eq(dossier: {