test(api): add a test to cover single (flat) attachment extension
This commit is contained in:
parent
1138604748
commit
e1270d5ffe
1 changed files with 20 additions and 0 deletions
|
@ -183,6 +183,16 @@ RSpec.describe Types::DossierType, type: :graphql do
|
|||
}
|
||||
end
|
||||
|
||||
describe 'dossier with motivation attachment' do
|
||||
let(:dossier) { create(:dossier, :accepte, :with_motivation, :with_justificatif) }
|
||||
let(:query) { DOSSIER_WITH_MOTIVATION_QUERY }
|
||||
let(:variables) { { number: dossier.id } }
|
||||
|
||||
it {
|
||||
expect(data[:dossier][:motivationAttachment][:url]).not_to be_nil
|
||||
}
|
||||
end
|
||||
|
||||
DOSSIER_QUERY = <<-GRAPHQL
|
||||
query($number: Int!) {
|
||||
dossier(number: $number) {
|
||||
|
@ -219,6 +229,16 @@ RSpec.describe Types::DossierType, type: :graphql do
|
|||
}
|
||||
GRAPHQL
|
||||
|
||||
DOSSIER_WITH_MOTIVATION_QUERY = <<-GRAPHQL
|
||||
query($number: Int!) {
|
||||
dossier(number: $number) {
|
||||
motivationAttachment {
|
||||
url
|
||||
}
|
||||
}
|
||||
}
|
||||
GRAPHQL
|
||||
|
||||
DOSSIER_WITH_CHAMPS_QUERY = <<-GRAPHQL
|
||||
query($number: Int!) {
|
||||
dossier(number: $number) {
|
||||
|
|
Loading…
Reference in a new issue