invite: rename 'email' to 'invite_email'

This commit is contained in:
Pierre de La Morinerie 2018-08-01 15:23:25 +00:00 committed by gregoirenovel
parent 030562a32f
commit 9541e781bb
3 changed files with 3 additions and 3 deletions

View file

@ -2,7 +2,7 @@ class InvitesController < ApplicationController
before_action :ensure_user_signed_in
def create
email = params[:email].downcase
email = params[:invite_email].downcase
invite = InviteUser.create(
dossier: current_user.dossiers.find(params[:dossier_id]),

View file

@ -20,5 +20,5 @@
%li
= form_tag invites_dossier_path(dossier_id: @facade.dossier.id), method: :post, class: 'form-inline', id: 'send-invitation' do
= text_field_tag :email, '', class: 'form-control', placeholder: 'Envoyer une invitation', id: 'invitation-email'
= text_field_tag :invite_email, '', class: 'form-control', placeholder: 'Envoyer une invitation', id: 'invite_email'
= submit_tag 'Ajouter', class: 'btn btn-success', data: { confirm: "Envoyer l'invitation ?" }

View file

@ -11,7 +11,7 @@ describe InvitesController, type: :controller do
sign_in signed_in_profile
end
subject { post :create, params: { dossier_id: dossier.id, email: email } }
subject { post :create, params: { dossier_id: dossier.id, invite_email: email } }
context "when gestionnaire is signed_in" do
let(:signed_in_profile) { create(:gestionnaire) }