Skip to content

Commit

Permalink
AP-5231: Skip emergency overrides for SCA applications
Browse files Browse the repository at this point in the history
When a user adds a delegated function date to an SCA application,
they should not see the Emergency override pages
  • Loading branch information
colinbruce committed Aug 29, 2024
1 parent 11e57c5 commit 3870f4d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/services/flow/proceeding_loop.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def next_step
when "client_involvement_type"
:delegated_functions
when "delegated_functions", "confirm_delegated_functions_date"
current_proceeding.used_delegated_functions? ? :emergency_defaults : :substantive_defaults
current_proceeding.used_delegated_functions? && !current_proceeding.special_childrens_act? ? :emergency_defaults : :substantive_defaults
when "emergency_defaults"
current_proceeding.accepted_emergency_defaults ? :substantive_defaults : :emergency_level_of_service
when "substantive_defaults"
Expand Down
15 changes: 15 additions & 0 deletions spec/services/flow/proceeding_loop_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,21 @@
it { is_expected.to be :emergency_defaults }
end

context "when the SCA proceeding has used delegated functions" do
let(:legal_aid_application) do
create(:legal_aid_application,
:with_proceedings,
:with_delegated_functions_on_proceedings,
explicit_proceedings: %i[pb003 pb007],
set_lead_proceeding: :pb007,
df_options:,
provider_step:)
end
let(:df_options) { { pb003: [10.days.ago, 10.days.ago], pb007: [10.days.ago, 10.days.ago], DA005: [nil, nil] } }

it { is_expected.to be :substantive_defaults }
end

context "and the proceeding has not used delegated functions" do
it { is_expected.to be :substantive_defaults }
end
Expand Down

0 comments on commit 3870f4d

Please sign in to comment.