Merge pull request #2307 from tchak/fix-do-not-show-email-in-messages-interface
Ne pas afficher les email des gestionnaires dans l'interface de messagerie
This commit is contained in:
commit
98c92f186b
2 changed files with 10 additions and 2 deletions
|
@ -14,7 +14,13 @@ class Commentaire < ApplicationRecord
|
||||||
after_create :notify
|
after_create :notify
|
||||||
|
|
||||||
def header
|
def header
|
||||||
"#{email}, #{I18n.l(created_at.localtime, format: '%d %b %Y %H:%M')}"
|
"#{sender}, #{I18n.l(created_at.localtime, format: '%d %b %Y %H:%M')}"
|
||||||
|
end
|
||||||
|
|
||||||
|
def sender
|
||||||
|
if email.present?
|
||||||
|
email.split('@').first
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def file_url
|
def file_url
|
||||||
|
|
|
@ -9,7 +9,7 @@ feature 'users: flux de commentaires' do
|
||||||
let(:champ2) { create(:champ, dossier: dossier, type_de_champ: create(:type_de_champ, libelle: "subtitle")) }
|
let(:champ2) { create(:champ, dossier: dossier, type_de_champ: create(:type_de_champ, libelle: "subtitle")) }
|
||||||
|
|
||||||
let!(:commentaire1) { create(:commentaire, dossier: dossier, champ: champ1) }
|
let!(:commentaire1) { create(:commentaire, dossier: dossier, champ: champ1) }
|
||||||
let!(:commentaire2) { create(:commentaire, dossier: dossier) }
|
let!(:commentaire2) { create(:commentaire, dossier: dossier, email: 'paul.chavard@beta.gouv.fr') }
|
||||||
let!(:commentaire3) { create(:commentaire, dossier: dossier, champ: champ2) }
|
let!(:commentaire3) { create(:commentaire, dossier: dossier, champ: champ2) }
|
||||||
let!(:commentaire4) { create(:commentaire, dossier: dossier, champ: champ1) }
|
let!(:commentaire4) { create(:commentaire, dossier: dossier, champ: champ1) }
|
||||||
|
|
||||||
|
@ -21,5 +21,7 @@ feature 'users: flux de commentaires' do
|
||||||
scenario "seuls les commentaires généraux sont affichés" do
|
scenario "seuls les commentaires généraux sont affichés" do
|
||||||
comments = find(".commentaires")
|
comments = find(".commentaires")
|
||||||
expect(comments).to have_selector(".content", count: 1)
|
expect(comments).to have_selector(".content", count: 1)
|
||||||
|
expect(comments).to have_content('paul.chavard')
|
||||||
|
expect(comments).not_to have_content('paul.chavard@beta.gouv.fr')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue