[Fix #1016] display notifications for avis

This commit is contained in:
Mathieu Magnin 2017-12-07 11:15:51 +01:00
parent 8e67e5c057
commit c3e7e39947
5 changed files with 33 additions and 6 deletions

View file

@ -0,0 +1,20 @@
describe 'new_gestionnaire/avis/avis_list.html.haml', type: :view do
before { view.extend DossierHelper }
subject { render 'new_gestionnaire/avis/avis_list.html.haml', avis: avis, avis_seen_at: seen_at, current_gestionnaire: gestionnaire }
let(:gestionnaire) { create(:gestionnaire) }
let(:avis) { [create(:avis, claimant: gestionnaire)] }
context "with a seen_at after avis created_at" do
let(:seen_at) { avis.first.created_at + 1.hour }
it { is_expected.not_to have_css(".highlighted") }
end
context "with a seen_at after avis created_at" do
let(:seen_at) { avis.first.created_at - 1.hour }
it { is_expected.to have_css(".highlighted") }
end
end