app: remove procedure_dossier_papertrail feature flag

The feature is now enabled for all procedures.
This commit is contained in:
Pierre de La Morinerie 2022-05-18 14:27:26 +02:00
parent 6269a35d3a
commit 4fcb85fd65
5 changed files with 10 additions and 28 deletions

View file

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

View file

@ -8,8 +8,6 @@
.container .container
= render partial: 'users/dossiers/show/status_overview', locals: { dossier: @dossier } = 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 } = render partial: 'users/dossiers/show/papertrail', locals: { dossier: @dossier }
- if !@dossier.termine? - if !@dossier.termine?

View file

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

View file

@ -16,17 +16,9 @@ RSpec.describe NotificationMailer, type: :mailer do
it 'renders the template' do it 'renders the template' do
expect(mail.subject).to eq('Email subject') expect(mail.subject).to eq('Email subject')
expect((mail.html_part || mail).body).to include('Your dossier was received') 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") expect(mail.attachments.first.filename).to eq("attestation-de-depot.pdf")
end end
end end
end
describe 'send_en_instruction_notification' do describe 'send_en_instruction_notification' do
let(:dossier) { create(:dossier, :en_construction, :with_individual, :with_service, user: user, procedure: procedure) } 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) expect(page).to have_text(dossier.commentaires.last.body)
end end
context 'when the deposit receipt feature is enabled' do scenario 'the user can download a deposit receipt' 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
visit dossier_path(dossier) 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}) expect(page).to have_link("Obtenir une attestation de dépôt de dossier", href: %r{dossiers/#{dossier.id}/papertrail.pdf})
end end
end
describe "the user can see the mean time they are expected to wait" do 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) } 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) }