add mailto
This commit is contained in:
parent
12760a43d7
commit
54b4679d19
8 changed files with 34 additions and 2 deletions
|
@ -29,7 +29,7 @@ feature '_Commentaires_Flux Admin/Dossier#Show Page' do
|
|||
|
||||
context 'Affichage du formulaire de commentaire' do
|
||||
scenario 'Le formulaire envoie vers /dossiers/:dossier_id/commentaire en #POST' do
|
||||
expect(page).to have_selector("form[action='/dossiers/#{dossier_id}/commentaire'][method=post]")
|
||||
expect(page).to have_selector("form[action='/admin/commentaire?dossier_id=#{dossier_id}'][method=post]")
|
||||
end
|
||||
|
||||
scenario 'Champs de texte' do
|
||||
|
|
|
@ -121,5 +121,12 @@ describe Dossier do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe '#mailto' do
|
||||
let(:dossier) { create(:dossier) }
|
||||
let(:email_contact) { dossier.formulaire.email_contact }
|
||||
subject { dossier.mailto }
|
||||
it { is_expected.to eq("mailto:#{email_contact}?subject=Demande%20de%20contact&body=Bonjour,%0A%0AJe%20vous%20informe%20que%20j'ai%20rempli%20le%20dossier%20sur%20admi_facile.%20Vous%20pouvez%20y%20acc%C3%A9der%20en%20suivant%20le%20lien%20suivant%20:%20%0Ahttps://admi_facile.apientreprise.fr/admin/dossiers/#{dossier.id}%20%0A%20Le%20num%C3%A9ro%20de%20mon%20dossier%20est%20le%20#{dossier.id}")}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
12
spec/views/recapitulatif/show.html.haml_spec.rb
Normal file
12
spec/views/recapitulatif/show.html.haml_spec.rb
Normal file
|
@ -0,0 +1,12 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe 'recapitulatif/show.html.haml', type: :view do
|
||||
let(:dossier) { create(:dossier, :with_entreprise) }
|
||||
before do
|
||||
assign(:dossier, dossier.decorate)
|
||||
assign(:commentaires, dossier.commentaires)
|
||||
render
|
||||
end
|
||||
it { expect(rendered).to have_content("Contacter l'administration") }
|
||||
it { expect(rendered).to include(dossier.mailto.gsub('&','&')) }
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue