2018-08-16 17:22:35 +02:00
|
|
|
describe 'shared/dossiers/messages/message.html.haml', type: :view do
|
2017-12-05 17:20:10 +01:00
|
|
|
before { view.extend DossierHelper }
|
|
|
|
|
2018-09-11 17:32:08 +02:00
|
|
|
subject { render 'shared/dossiers/messages/message.html.haml', commentaire: commentaire, messagerie_seen_at: seen_at, connected_user: dossier.user }
|
2017-12-05 17:20:10 +01:00
|
|
|
|
2019-07-02 15:21:49 +02:00
|
|
|
let(:dossier) { create(:dossier, :en_construction) }
|
2017-12-05 17:20:10 +01:00
|
|
|
let(:commentaire) { create(:commentaire, dossier: dossier) }
|
|
|
|
let(:seen_at) { commentaire.created_at + 1.hour }
|
|
|
|
|
|
|
|
context "with a seen_at after commentaire created_at" do
|
|
|
|
let(:seen_at) { commentaire.created_at + 1.hour }
|
|
|
|
|
|
|
|
it { is_expected.not_to have_css(".highlighted") }
|
|
|
|
end
|
|
|
|
|
|
|
|
context "with a seen_at after commentaire created_at" do
|
|
|
|
let(:seen_at) { commentaire.created_at - 1.hour }
|
|
|
|
|
|
|
|
it { is_expected.to have_css(".highlighted") }
|
|
|
|
end
|
|
|
|
end
|