helpers: allow champ without persisted dossier
This fixes the /patron page. I also added an end-to-end test to avoid breaking this page in the future.
This commit is contained in:
parent
854274cae3
commit
2b90d7cc01
2 changed files with 9 additions and 1 deletions
|
@ -28,7 +28,7 @@ module ChampHelper
|
|||
|
||||
def autosave_available?(champ)
|
||||
# FIXME: enable autosave on champs private? once we figured out how to batch audit events
|
||||
champ.dossier.brouillon? && !champ.repetition?
|
||||
champ.dossier&.brouillon? && !champ.repetition?
|
||||
end
|
||||
|
||||
def geo_area_label(geo_area)
|
||||
|
|
8
spec/system/patron_spec.rb
Normal file
8
spec/system/patron_spec.rb
Normal file
|
@ -0,0 +1,8 @@
|
|||
describe 'Accessing the /patron page:' do
|
||||
scenario 'I can display a page with all form fields and UI elements' do
|
||||
visit patron_path
|
||||
expect(page).to have_text('Icônes')
|
||||
expect(page).to have_text('Formulaires')
|
||||
expect(page).to have_text('Boutons')
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue