header: fix link to the contact email

This commit is contained in:
Pierre de La Morinerie 2018-06-25 11:26:37 +02:00
parent 5242e125dd
commit 51e256e122
2 changed files with 10 additions and 1 deletions

View file

@ -29,7 +29,8 @@
%br
par téléphone : 01 76 42 02 87
%br
= " par email : <a href='mailto:#{CONTACT_EMAIL}'>#{CONTACT_EMAIL}</a>"
par email :
= link_to CONTACT_EMAIL, "mailto:#{CONTACT_EMAIL}"
- if nav_bar_profile == :user
%ul.header-tabs

View file

@ -3,6 +3,7 @@ require 'spec_helper'
describe 'layouts/_new_header.html.haml', type: :view do
describe 'logo link' do
before do
sign_in user
allow(controller).to receive(:nav_bar_profile).and_return(profile)
render
end
@ -10,15 +11,22 @@ describe 'layouts/_new_header.html.haml', type: :view do
subject { rendered }
context 'when rendering for user' do
let(:user) { create(:user) }
let(:profile) { :user }
it { is_expected.to have_css("a.header-logo[href=\"#{users_dossiers_path}\"]") }
end
context 'when rendering for gestionnaire' do
let(:user) { create(:gestionnaire) }
let(:profile) { :gestionnaire }
it { is_expected.to have_css("a.header-logo[href=\"#{gestionnaire_procedures_path}\"]") }
it "displays the contact infos" do
expect(rendered).to have_text("Contact")
expect(rendered).to have_link(CONTACT_EMAIL, href: "mailto:#{CONTACT_EMAIL}")
end
end
end
end