helper: simplify DossierHelper.url_for_dossier
The argument is never an Invite
This commit is contained in:
parent
b6ea2f1b36
commit
33c743ab77
2 changed files with 1 additions and 8 deletions
|
@ -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)
|
||||
|
|
|
@ -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" }
|
||||
|
|
Loading…
Reference in a new issue