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
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: {