Merge pull request #7348 from betagouv/remove-deposit-receipt-feature-flag

Usager : activation de l'attestation de dépôt pour toutes les démarches
This commit is contained in:
Pierre de La Morinerie 2022-05-24 17:38:03 +02:00 committed by GitHub
commit 480c51cc80
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 28 deletions

View file

@ -22,13 +22,11 @@ module Mails
DOSSIER_STATE = Dossier.states.fetch(:en_construction)
def attachment_for_dossier(dossier)
if procedure.feature_enabled?(:procedure_dossier_papertrail)
{
filename: I18n.t('users.dossiers.show.papertrail.filename'),
content: deposit_receipt_for_dossier(dossier)
}
end
end
private

View file

@ -8,8 +8,6 @@
.container
= render partial: 'users/dossiers/show/status_overview', locals: { dossier: @dossier }
- if @dossier.procedure.feature_enabled?(:procedure_dossier_papertrail)
= render partial: 'users/dossiers/show/papertrail', locals: { dossier: @dossier }
- if !@dossier.termine?

View file

@ -26,8 +26,7 @@ features = [
:hide_instructeur_email,
:procedure_revisions,
:procedure_routage_api,
:procedure_process_expired_dossiers_termine,
:procedure_dossier_papertrail
:procedure_process_expired_dossiers_termine
]
def database_exists?

View file

@ -16,17 +16,9 @@ RSpec.describe NotificationMailer, type: :mailer do
it 'renders the template' do
expect(mail.subject).to eq('Email subject')
expect((mail.html_part || mail).body).to include('Your dossier was received')
end
context 'when the deposit receipt feature is enabled' do
before { Flipper.enable(:procedure_dossier_papertrail, procedure) }
after { Flipper.disable(:procedure_dossier_papertrail, procedure) }
it 'attaches the deposit receipt' do
expect(mail.attachments.first.filename).to eq("attestation-de-depot.pdf")
end
end
end
describe 'send_en_instruction_notification' do
let(:dossier) { create(:dossier, :en_construction, :with_individual, :with_service, user: user, procedure: procedure) }

View file

@ -16,15 +16,10 @@ describe 'Dossier details:' do
expect(page).to have_text(dossier.commentaires.last.body)
end
context 'when the deposit receipt feature is enabled' do
before { Flipper.enable(:procedure_dossier_papertrail, procedure) }
after { Flipper.disable(:procedure_dossier_papertrail, procedure) }
it 'displays a link to download a deposit receipt' do
scenario 'the user can download a deposit receipt' do
visit dossier_path(dossier)
expect(page).to have_link("Obtenir une attestation de dépôt de dossier", href: %r{dossiers/#{dossier.id}/papertrail.pdf})
end
end
describe "the user can see the mean time they are expected to wait" do
let(:other_dossier) { create(:dossier, :accepte, :with_individual, procedure: procedure, depose_at: 10.days.ago, en_instruction_at: 9.days.ago, processed_at: Time.zone.now) }