Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AP-5639: Add routing to ECCT for PLF Second Appeal cases
Browse files Browse the repository at this point in the history
Create a test and update the factory for the PLF proceeding in use
colinbruce committed Jan 31, 2025
1 parent a675cd9 commit 4649c40
Showing 2 changed files with 42 additions and 0 deletions.
4 changes: 4 additions & 0 deletions spec/factories/proceedings.rb
Original file line number Diff line number Diff line change
@@ -418,6 +418,10 @@
ccms_matter_code { "KPBLB" }
client_involvement_type_ccms_code { "A" }
client_involvement_type_description { "Applicant/Claimant/Petitioner" }
after(:create) do |proceeding, evaluator|
create(:scope_limitation, :emergency, proceeding:) unless evaluator.no_scope_limitations
create(:scope_limitation, :substantive, proceeding:) unless evaluator.no_scope_limitations
end
end

trait :pbm32 do
38 changes: 38 additions & 0 deletions spec/services/ccms/requestors/case_add_requestor_spec.rb
Original file line number Diff line number Diff line change
@@ -420,6 +420,44 @@ module Requestors
expect(block).to be_present
end
end

describe "when the application has a PLF Appeal proceeding" do
let(:legal_aid_application) do
create(:legal_aid_application,
:with_everything,
:with_positive_benefit_check_result,
:with_proceedings,
explicit_proceedings: %i[pbm01a],
set_lead_proceeding: :pbm01a,
applicant:,
vehicles:,
other_assets_declaration:,
savings_amount:,
provider:,
opponents:,
domestic_abuse_summary:,
office:)
end
let(:proceeding) { legal_aid_application.proceedings.detect { |p| p.ccms_code == "PBM01A" } }

context "and the provider answered no to the Second Appeal merits question" do
before { create(:appeal, legal_aid_application:) }

it "sets the ECF_FLAG value to false" do
block = XmlExtractor.call(request_xml, :global_merits, "ECF_FLAG")
expect(block).to have_boolean_response false
end
end

context "and the provider answered yes to the Second Appeal merits question" do
before { create(:appeal, second_appeal: true, legal_aid_application:) }

it "sets the ECF_FLAG value to true" do
block = XmlExtractor.call(request_xml, :global_merits, "ECF_FLAG")
expect(block).to have_boolean_response true
end
end
end
end
end
end

0 comments on commit 4649c40

Please sign in to comment.