Skip to content

Commit

Permalink
Correct funding message showing for the NPQ LTD
Browse files Browse the repository at this point in the history
  • Loading branch information
javier-npq committed Jul 17, 2023
1 parent 7b258ba commit e40ee9a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions app/lib/forms/possible_funding.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ def after_save

def message_template
return "private_childcare_provider" if institution.is_a?(PrivateChildcareProvider)
return "lead_mentor" if Course.npqltd.include?(course)
return "funding_eligibility_unclear" if works_in_other? && (employment_type_other? || valid_employent_type_for_england?)
return "lead_mentor" if Course.npqltd.include?(course) && !is_funding_eligibility_unclear?
return "funding_eligibility_unclear" if is_funding_eligibility_unclear?

if targeted_delivery_funding_eligibility?
"eligible_for_scholarship_funding"
Expand All @@ -48,6 +48,10 @@ def valid_employent_type_for_england?
wizard.query_store.valid_employent_type_for_england?
end

def is_funding_eligibility_unclear?
works_in_other? && (employment_type_other? || valid_employent_type_for_england?)
end

def targeted_delivery_funding_eligibility?
wizard.query_store.targeted_delivery_funding_eligibility?
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def run_scenario(js:)

expect_page_to_have(path: "/registration/possible-funding", submit_form: true) do
expect(page).to have_text("Funding eligibility")
expect(page).to have_text("You’re eligible for scholarship funding for the")
expect(page).to have_text("If you are eligible, you would not have to pay for the course fees.")
end

expect_page_to_have(path: "/registration/choose-your-provider", submit_form: true) do
Expand Down

0 comments on commit e40ee9a

Please sign in to comment.