From 33c743ab772ffba5273246d336a0b368ccf770f6 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Wed, 4 Jul 2018 09:59:35 +0200 Subject: [PATCH] helper: simplify DossierHelper.url_for_dossier The argument is never an Invite --- app/helpers/dossier_helper.rb | 4 +--- spec/helpers/dossier_helper_spec.rb | 5 ----- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/app/helpers/dossier_helper.rb b/app/helpers/dossier_helper.rb index 9baaf6d16..f6769e34c 100644 --- a/app/helpers/dossier_helper.rb +++ b/app/helpers/dossier_helper.rb @@ -16,9 +16,7 @@ module DossierHelper end def url_for_dossier(dossier) - if dossier.kind_of? Invite - users_dossiers_invite_path(id: dossier.id) - elsif dossier.brouillon? + if dossier.brouillon? modifier_dossier_path(dossier) else users_dossier_recapitulatif_path(dossier) diff --git a/spec/helpers/dossier_helper_spec.rb b/spec/helpers/dossier_helper_spec.rb index c2aa7d0d4..9d12f985a 100644 --- a/spec/helpers/dossier_helper_spec.rb +++ b/spec/helpers/dossier_helper_spec.rb @@ -29,11 +29,6 @@ RSpec.describe DossierHelper, type: :helper do describe ".url_for_dossier" do subject { url_for_dossier(dossier) } - context "when the dossier is an invitation" do - let(:dossier) { create(:invite) } - it { is_expected.to eq "/users/dossiers/invites/#{dossier.id}" } - end - context "when the dossier is in the brouillon state" do let(:dossier) { create(:dossier, state: 'brouillon') } it { is_expected.to eq "/dossiers/#{dossier.id}/modifier" }