messagerie: fix 'Invité' label in message sender
This commit is contained in:
parent
211674435e
commit
353ab812fc
3 changed files with 22 additions and 1 deletions
|
@ -19,6 +19,23 @@ RSpec.describe CommentaireHelper, type: :helper do
|
|||
end
|
||||
end
|
||||
|
||||
describe '.commentaire_is_from_guest' do
|
||||
let(:dossier) { create(:dossier) }
|
||||
let!(:guest) { create(:invite_user, dossier: dossier) }
|
||||
|
||||
subject { commentaire_is_from_guest(commentaire) }
|
||||
|
||||
context 'when the commentaire sender is not a guest' do
|
||||
let(:commentaire) { create(:commentaire, dossier: dossier, email: "michel@pref.fr") }
|
||||
it { is_expected.to be false }
|
||||
end
|
||||
|
||||
context 'when the commentaire sender is a guest on this dossier' do
|
||||
let(:commentaire) { create(:commentaire, dossier: dossier, email: guest.email) }
|
||||
it { is_expected.to be true }
|
||||
end
|
||||
end
|
||||
|
||||
describe '.commentaire_date' do
|
||||
let(:present_date) { Time.local(2018, 9, 2, 10, 5, 0) }
|
||||
let(:creation_date) { present_date }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue