instructeurs: make the create form not using email directly

Before the form attempted to read an email value from the Instructeur
model, and failed (because the empty Instructeur had no user yet).

We could let `Instructeur#email` return `nil` if there is no User –
but as a created Instructeur is always supposed to have a User, this
seems like a nice safeguard to keep.

So instead this commit rewrites the create form, which now doesn’t
depend on an Instructeur model. Seems easy enough for now.
This commit is contained in:
Pierre de La Morinerie 2019-10-17 14:07:12 +00:00
parent d78d206544
commit f131dbb80d
6 changed files with 11 additions and 16 deletions

View file

@ -12,7 +12,7 @@ feature 'As an instructeur', js: true do
fill_in :instructeur_email, with: instructeur_email
perform_enqueued_jobs do
click_button 'Valider'
click_button 'Ajouter'
end
end