parent
8e3d85ac84
commit
158d6e1ae6
4 changed files with 24 additions and 7 deletions
|
@ -1,3 +1,5 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe 'gestionnaires/shared/avis/_list.html.haml', type: :view do
|
||||
before { view.extend DossierHelper }
|
||||
|
||||
|
@ -5,16 +7,22 @@ describe 'gestionnaires/shared/avis/_list.html.haml', type: :view do
|
|||
|
||||
let(:gestionnaire) { create(:gestionnaire) }
|
||||
let(:avis) { [create(:avis, claimant: gestionnaire)] }
|
||||
let(:seen_at) { avis.first.created_at + 1.hour }
|
||||
|
||||
context "with a seen_at after avis created_at" do
|
||||
let(:seen_at) { avis.first.created_at + 1.hour }
|
||||
it { is_expected.to have_text(avis.first.introduction) }
|
||||
it { is_expected.not_to have_css(".highlighted") }
|
||||
|
||||
it { is_expected.not_to have_css(".highlighted") }
|
||||
end
|
||||
|
||||
context "with a seen_at after avis created_at" do
|
||||
context 'with a seen_at before avis created_at' do
|
||||
let(:seen_at) { avis.first.created_at - 1.hour }
|
||||
|
||||
it { is_expected.to have_css(".highlighted") }
|
||||
end
|
||||
|
||||
context 'with an answer' do
|
||||
let(:avis) { [create(:avis, :with_answer, claimant: gestionnaire)] }
|
||||
|
||||
it 'renders the answer formatted with newlines' do
|
||||
expect(subject).to include(simple_format(avis.first.answer))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue