[GraphQL]: test unauthorized mutation

This commit is contained in:
Paul Chavard 2019-11-07 16:30:37 +01:00
parent 3db741b6b6
commit f0ac01bf19

View file

@ -263,5 +263,26 @@ describe API::V2::GraphqlController do
expect(gql_errors).not_to eq(nil)
end
end
context "mutation" do
let(:query) do
"mutation {
dossierEnvoyerMessage(input: {
dossierId: \"#{dossier.to_typed_id}\",
instructeurId: \"#{instructeur.to_typed_id}\",
body: \"Bonjour\"
}) {
message {
body
}
}
}"
end
it "should return error" do
expect(gql_data[:dossierEnvoyerMessage]).to eq(nil)
expect(gql_errors).not_to eq(nil)
end
end
end
end