dossier: remove feature flag
This commit is contained in:
parent
f007eaa2ee
commit
758ccff984
11 changed files with 8 additions and 141 deletions
|
@ -28,9 +28,6 @@ module NewUser
|
|||
def show
|
||||
if dossier.brouillon?
|
||||
redirect_to brouillon_dossier_path(dossier)
|
||||
|
||||
elsif !Flipflop.new_dossier_details?
|
||||
redirect_to users_dossier_recapitulatif_path(dossier)
|
||||
end
|
||||
|
||||
@dossier = dossier
|
||||
|
@ -125,15 +122,7 @@ module NewUser
|
|||
flash.now.alert = errors
|
||||
render :modifier
|
||||
else
|
||||
if Flipflop.new_dossier_details?
|
||||
redirect_to demande_dossier_path(@dossier)
|
||||
else
|
||||
if current_user.owns?(dossier)
|
||||
redirect_to users_dossier_recapitulatif_path(@dossier)
|
||||
else
|
||||
redirect_to users_dossiers_invite_path(@dossier.invite_for_user(current_user))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -14,10 +14,8 @@ class Users::Dossiers::InvitesController < UsersController
|
|||
|
||||
if @facade.dossier.brouillon?
|
||||
redirect_to brouillon_dossier_path(@facade.dossier)
|
||||
elsif Flipflop.new_dossier_details?
|
||||
return redirect_to dossier_path(@facade.dossier)
|
||||
else
|
||||
render 'users/recapitulatif/show'
|
||||
return redirect_to dossier_path(@facade.dossier)
|
||||
end
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
flash.alert = t('errors.messages.dossier_not_found')
|
||||
|
|
|
@ -4,11 +4,7 @@ class Users::RecapitulatifController < UsersController
|
|||
end
|
||||
|
||||
def show
|
||||
if Flipflop.new_dossier_details?
|
||||
redirect_to dossier_url(current_user_dossier)
|
||||
else
|
||||
create_dossier_facade
|
||||
end
|
||||
end
|
||||
|
||||
def initiate
|
||||
|
|
|
@ -18,10 +18,8 @@ module DossierHelper
|
|||
def url_for_dossier(dossier)
|
||||
if dossier.brouillon?
|
||||
brouillon_dossier_path(dossier)
|
||||
elsif Flipflop.new_dossier_details?
|
||||
dossier_path(dossier)
|
||||
else
|
||||
users_dossier_recapitulatif_path(dossier)
|
||||
dossier_path(dossier)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -20,10 +20,7 @@
|
|||
= link_to service.email, "mailto:#{service.email}"
|
||||
- else
|
||||
Directement
|
||||
- if Flipflop.new_dossier_details?
|
||||
= link_to "par la messagerie", messagerie_dossier_path(dossier)
|
||||
- else
|
||||
= link_to "par la messagerie", users_dossier_recapitulatif_path(dossier)
|
||||
|
||||
%p
|
||||
Par téléphone :
|
||||
|
|
|
@ -18,7 +18,4 @@
|
|||
%b échanger avec un instructeur
|
||||
lors de sa construction et de son instruction
|
||||
|
||||
- if Flipflop.new_dossier_details?
|
||||
= link_to 'Accéder à votre dossier', dossier_path(@dossier), class: 'button large primary'
|
||||
- else
|
||||
= link_to 'Accéder à votre dossier', users_dossier_recapitulatif_path(@dossier), class: 'button large primary'
|
||||
|
|
|
@ -19,10 +19,6 @@ Flipflop.configure do
|
|||
feature :publish_draft
|
||||
feature :support_form
|
||||
|
||||
feature :new_dossier_details,
|
||||
title: "Nouvelle page « Dossier »",
|
||||
default: true
|
||||
|
||||
group :production do
|
||||
feature :remote_storage,
|
||||
default: ENV['FOG_ENABLED'] == 'enabled'
|
||||
|
|
|
@ -578,10 +578,7 @@ describe NewUser::DossiersController, type: :controller do
|
|||
end
|
||||
|
||||
describe '#show' do
|
||||
let(:new_dossier_details_enabled) { false }
|
||||
|
||||
before do
|
||||
Flipflop::FeatureSet.current.test!.switch!(:new_dossier_details, new_dossier_details_enabled)
|
||||
sign_in(user)
|
||||
end
|
||||
|
||||
|
@ -594,25 +591,15 @@ describe NewUser::DossiersController, type: :controller do
|
|||
|
||||
context 'when the dossier has been submitted' do
|
||||
let(:dossier) { create(:dossier, :en_construction, user: user) }
|
||||
|
||||
context 'and the new dossier details page is disabled' do
|
||||
let(:new_dossier_details_enabled) { false }
|
||||
it { is_expected.to redirect_to(users_dossier_recapitulatif_path(dossier)) }
|
||||
end
|
||||
|
||||
context 'and the new dossier details page is enabled' do
|
||||
let(:new_dossier_details_enabled) { true }
|
||||
it { expect(assigns(:dossier)).to eq(dossier) }
|
||||
it { is_expected.to render_template(:show) }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe '#formulaire' do
|
||||
let(:dossier) { create(:dossier, :en_construction, user: user) }
|
||||
|
||||
before do
|
||||
Flipflop::FeatureSet.current.test!.switch!(:new_dossier_details, true)
|
||||
sign_in(user)
|
||||
end
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@ describe 'Dossier details:' do
|
|||
let(:dossier) { create(:dossier, :en_construction, :for_individual, :with_commentaires, user: user, procedure: procedure) }
|
||||
|
||||
before do
|
||||
Flipflop::FeatureSet.current.test!.switch!(:new_dossier_details, true)
|
||||
visit_dossier dossier
|
||||
end
|
||||
|
||||
|
|
|
@ -75,10 +75,6 @@ feature 'Invitations' do
|
|||
context 'when the dossier is en_construction' do
|
||||
let!(:dossier) { create(:dossier, :for_individual, :en_construction, user: owner, procedure: procedure) }
|
||||
|
||||
before do
|
||||
Flipflop::FeatureSet.current.test!.switch!(:new_dossier_details, true)
|
||||
end
|
||||
|
||||
scenario 'on dossier details, the owner of a dossier can invite another user to collaborate on the dossier', js: true do
|
||||
log_in(owner)
|
||||
navigate_to_dossier(dossier)
|
||||
|
@ -101,47 +97,6 @@ feature 'Invitations' do
|
|||
end
|
||||
end
|
||||
|
||||
context 'when the dossier is en_construction (legacy UI)' do
|
||||
let!(:dossier) { create(:dossier, :for_individual, :en_construction, user: owner, procedure: procedure) }
|
||||
|
||||
before do
|
||||
Flipflop::FeatureSet.current.test!.switch!(:new_dossier_details, false)
|
||||
end
|
||||
|
||||
scenario 'on dossier details, a user can invite another user to collaborate on the dossier', js: true do
|
||||
log_in(owner)
|
||||
navigate_to_recapitulatif(dossier)
|
||||
|
||||
legacy_send_invite_to "user_invite@exemple.fr"
|
||||
|
||||
expect(page).to have_current_path(users_dossier_recapitulatif_path(dossier))
|
||||
expect(page).to have_text("Une invitation a été envoyée à user_invite@exemple.fr.")
|
||||
expect(page).to have_text("user_invite@exemple.fr")
|
||||
end
|
||||
|
||||
scenario 'an invited user can see and edit the dossier', js: true do
|
||||
visit users_dossiers_invite_path(invite)
|
||||
expect(page).to have_current_path(new_user_session_path)
|
||||
|
||||
submit_login_form(invited_user.email, invited_user.password)
|
||||
expect(page).to have_current_path(users_dossiers_invite_path(invite))
|
||||
expect(page).to have_no_selector('.button.invite-user-action')
|
||||
expect(page).to have_text("Dossier nº #{dossier.id}")
|
||||
|
||||
# We should be able to just click() the link, but Capybara detects that the
|
||||
# enclosing div would be clicked instead.
|
||||
expect(page).to have_link("MODIFIER", href: brouillon_dossier_path(dossier))
|
||||
visit brouillon_dossier_path(dossier)
|
||||
|
||||
expect(page).to have_current_path(brouillon_dossier_path(dossier))
|
||||
fill_in "Texte obligatoire", with: "Some edited value"
|
||||
click_button "Enregistrer les modifications du dossier"
|
||||
|
||||
expect(page).to have_current_path(users_dossiers_invite_path(invite))
|
||||
expect(page).to have_text("Some edited value")
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def log_in(user)
|
||||
|
@ -175,12 +130,6 @@ feature 'Invitations' do
|
|||
submit_login_form(invited_user.email, invited_user.password)
|
||||
end
|
||||
|
||||
def navigate_to_recapitulatif(dossier)
|
||||
expect(page).to have_current_path(dossiers_path)
|
||||
click_on(dossier.id)
|
||||
expect(page).to have_current_path(users_dossier_recapitulatif_path(dossier))
|
||||
end
|
||||
|
||||
def send_invite_to(invited_email)
|
||||
click_on "Inviter une personne à modifier ce dossier"
|
||||
expect(page).to have_button("Envoyer une invitation", visible: true)
|
||||
|
@ -188,15 +137,4 @@ feature 'Invitations' do
|
|||
fill_in 'invite_email', with: invited_email
|
||||
click_on "Envoyer une invitation"
|
||||
end
|
||||
|
||||
def legacy_send_invite_to(invited_email)
|
||||
find('.dropdown-toggle', text: "Voir les personnes impliquées").click()
|
||||
expect(page).to have_button("Ajouter", visible: true)
|
||||
|
||||
fill_in 'invite_email', with: invited_email
|
||||
|
||||
page.accept_alert "Envoyer l'invitation ?" do
|
||||
click_on "Ajouter"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
require 'spec_helper'
|
||||
|
||||
feature 'users: flux de commentaires' do
|
||||
let(:user) { create(:user) }
|
||||
let(:dossier) { create(:dossier, :with_entreprise, user: user, state: Dossier.states.fetch(:en_construction)) }
|
||||
let(:dossier_id) { dossier.id }
|
||||
|
||||
let(:champ1) { dossier.champs.first }
|
||||
let(:champ2) { create(:champ, dossier: dossier, type_de_champ: create(:type_de_champ, libelle: "subtitle")) }
|
||||
|
||||
let!(:commentaire1) { create(:commentaire, dossier: dossier, champ: champ1) }
|
||||
let!(:commentaire2) { create(:commentaire, dossier: dossier, email: 'paul.chavard@beta.gouv.fr') }
|
||||
let!(:commentaire3) { create(:commentaire, dossier: dossier, champ: champ2) }
|
||||
let!(:commentaire4) { create(:commentaire, dossier: dossier, champ: champ1) }
|
||||
|
||||
before do
|
||||
Flipflop::FeatureSet.current.test!.switch!(:new_dossier_details, false)
|
||||
login_as user, scope: :user
|
||||
visit users_dossier_recapitulatif_path(dossier)
|
||||
end
|
||||
|
||||
scenario "seuls les commentaires généraux sont affichés" do
|
||||
comments = find(".commentaires")
|
||||
expect(comments).to have_selector(".content", count: 1)
|
||||
expect(comments).to have_content('paul.chavard')
|
||||
expect(comments).not_to have_content('paul.chavard@beta.gouv.fr')
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue