Add Commentaire.is_sent_by_system? and .is_sent_by(someone)
And use it in CommentaireHelper and in the _message_icon and _message_issuer partials
This commit is contained in:
parent
2abd93d360
commit
3f439ac07a
5 changed files with 30 additions and 18 deletions
|
@ -7,6 +7,18 @@ describe Commentaire do
|
|||
it { is_expected.to have_db_column(:updated_at) }
|
||||
it { is_expected.to belong_to(:dossier) }
|
||||
|
||||
describe "#is_sent_by_system?" do
|
||||
subject { commentaire.is_sent_by_system? }
|
||||
|
||||
let(:commentaire) { build :commentaire, email: email }
|
||||
|
||||
context 'with a commentaire created by the DS system' do
|
||||
let(:email) { CONTACT_EMAIL }
|
||||
|
||||
it { is_expected.to be_truthy }
|
||||
end
|
||||
end
|
||||
|
||||
describe "#redacted_email" do
|
||||
subject { commentaire.redacted_email }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue