feat(dossier/projection): supports pending_correction?
This commit is contained in:
parent
7a9917fb32
commit
538e24fa7e
2 changed files with 45 additions and 2 deletions
|
@ -248,6 +248,29 @@ describe DossierProjectionService do
|
|||
it { is_expected.to eq("") }
|
||||
end
|
||||
end
|
||||
|
||||
context 'for dossier reolutions table' do
|
||||
let(:table) { 'dossier_resolutions' }
|
||||
let(:column) { 'resolved_at' }
|
||||
let(:dossier) { create(:dossier, :en_construction) }
|
||||
subject { described_class.project(dossiers_ids, fields)[0] }
|
||||
|
||||
context "when dossier has pending correction" do
|
||||
before { create(:dossier_resolution, dossier:) }
|
||||
|
||||
it { expect(subject.pending_correction?).to be(true) }
|
||||
end
|
||||
|
||||
context "when dossier has a resolved correction" do
|
||||
before { create(:dossier_resolution, :resolved, dossier:) }
|
||||
|
||||
it { expect(subject.pending_correction?).to eq(false) }
|
||||
end
|
||||
|
||||
context "when dossier has no correction at all" do
|
||||
it { expect(subject.pending_correction?).to eq(false) }
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue