Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/puppeteer-23.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
willc-work authored Sep 19, 2024
2 parents d6f3942 + 5e43e5e commit f0ecdac
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ gem "hexapdf"
gem "devise"
gem "omniauth-google-oauth2"
gem "omniauth-rails_csrf_protection", ">= 1.0.2"
gem "omniauth-saml", "~> 2.1.0"
gem "omniauth-saml", "~> 2.2.1"

gem "rails_admin"

Expand Down
26 changes: 14 additions & 12 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ GEM
crass (1.0.6)
cssbundling-rails (1.4.1)
railties (>= 6.0.0)
csv (3.3.0)
database_cleaner (2.0.2)
database_cleaner-active_record (>= 2, < 3)
database_cleaner-active_record (2.1.0)
Expand Down Expand Up @@ -220,7 +221,7 @@ GEM
openssl (>= 2.2.1)
html-attributes-utils (1.0.2)
activesupport (>= 6.1.4.4)
i18n (1.14.5)
i18n (1.14.6)
concurrent-ruby (~> 1.0)
ice_nine (0.11.2)
interception (0.5)
Expand Down Expand Up @@ -269,7 +270,7 @@ GEM
uri
net-http-persistent (4.0.1)
connection_pool (~> 2.2)
net-imap (0.4.14)
net-imap (0.4.16)
date
net-protocol
net-pop (0.1.2)
Expand Down Expand Up @@ -309,14 +310,14 @@ GEM
omniauth-rails_csrf_protection (1.0.2)
actionpack (>= 4.2)
omniauth (~> 2.0)
omniauth-saml (2.1.0)
omniauth (~> 2.0)
ruby-saml (~> 1.12)
omniauth-saml (2.2.1)
omniauth (~> 2.1)
ruby-saml (~> 1.17)
openssl (3.2.0)
orm_adapter (0.5.0)
pagy (9.0.8)
parallel (1.26.3)
parallel_tests (4.7.1)
parallel_tests (4.7.2)
parallel
parser (3.3.5.0)
ast (~> 2.4.1)
Expand All @@ -326,7 +327,7 @@ GEM
rexml (~> 3.2, >= 3.2.6)
safe_shell (>= 1.0.3, < 2.0)
pg (1.5.8)
propshaft (0.9.1)
propshaft (1.0.0)
actionpack (>= 7.0.0)
activesupport (>= 7.0.0)
rack
Expand Down Expand Up @@ -383,12 +384,13 @@ GEM
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
rails_admin (3.1.4)
rails_admin (3.2.0)
activemodel-serializers-xml (>= 1.0)
csv
kaminari (>= 0.14, < 2.0)
nested_form (~> 0.3)
rails (>= 6.0, < 8)
turbo-rails (~> 1.0)
turbo-rails (>= 1.0, < 3)
railties (7.1.3.4)
actionpack (= 7.1.3.4)
activesupport (= 7.1.3.4)
Expand Down Expand Up @@ -484,7 +486,7 @@ GEM
rubocop (~> 1.61)
ruby-progressbar (1.13.0)
ruby-rc4 (0.1.5)
ruby-saml (1.16.0)
ruby-saml (1.17.0)
nokogiri (>= 1.13.10)
rexml
rubyzip (2.3.2)
Expand Down Expand Up @@ -528,7 +530,7 @@ GEM
thread_safe (0.3.6)
tilt (2.4.0)
timeout (0.4.1)
turbo-rails (1.5.0)
turbo-rails (2.0.6)
actionpack (>= 6.0.0)
activejob (>= 6.0.0)
railties (>= 6.0.0)
Expand Down Expand Up @@ -604,7 +606,7 @@ DEPENDENCIES
jsbundling-rails
omniauth-google-oauth2
omniauth-rails_csrf_protection (>= 1.0.2)
omniauth-saml (~> 2.1.0)
omniauth-saml (~> 2.2.1)
parallel_tests
pdf-forms
pg (~> 1.5)
Expand Down
4 changes: 2 additions & 2 deletions app/services/check_answers/sections/case_details.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ def initialize(check)
def subsections
tables = [level_of_help_table]
if @check.under_eighteen?
tables += [aggregated_means_table] unless @check.controlled_clr?
tables += [aggregated_means_table] unless @check.controlled_clr? || !@check.controlled?
tables += [immigration_or_asylum_table] if @check.under_eighteen_assets? || @check.under_eighteen_regular_income? || @check.aggregated_means?
tables += [immigration_or_asylum_type_table, asylum_support_table] if @check.immigration_or_asylum? && !@check.controlled_clr?
tables += [immigration_or_asylum_type_table, asylum_support_table] if @check.immigration_or_asylum && !@check.controlled_clr?
else
tables += if @check.controlled?
[immigration_or_asylum_table]
Expand Down
58 changes: 52 additions & 6 deletions spec/flows/under_eighteen_flow_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -373,14 +373,60 @@
end
end

it "exits early for certificated work" do
fill_in_client_age_screen(choice: "Under 18")
fill_in_level_of_help_screen(choice: "Civil certificated")
confirm_screen(:check_answers)
expect(page).not_to have_content clr_text
context "when starting with over 18 controlled check that is an immigration matter type, change answer to under 18" do
before do
fill_in_client_age_screen(choice: "18 to 59")
fill_in_level_of_help_screen(choice: "Civil controlled work or family mediation")
fill_in_immigration_or_asylum_screen(choice: "Yes")
fill_in_immigration_or_asylum_type_screen(choice: "Immigration - controlled legal representation (CLR) in the First-tier Tribunal")
fill_in_asylum_support_screen
fill_in_forms_until(:check_answers)
within "#table-client_age" do
click_on "Change"
end
fill_in_client_age_screen(choice: "Under 18")
fill_in_under_18_controlled_legal_rep_screen(choice: "No")
fill_in_aggregated_means_screen(choice: "No")
fill_in_regular_income_screen(choice: "No")
fill_in_under_eighteen_assets_screen(choice: "No")
confirm_screen("check_answers")
end

it "shows correct sections" do
expect(all(".govuk-summary-card__title").map(&:text))
.to eq(
[
"Client age",
"Level of help",
"Means tests for under 18s",
],
)
end
end

context "when doing a certificated check" do
before do
fill_in_client_age_screen(choice: "Under 18")
fill_in_level_of_help_screen(choice: "Civil certificated")
end

it "hits check answers" do
confirm_screen(:check_answers)
expect(page).not_to have_content clr_text
end

it "shows correct sections" do
expect(all(".govuk-summary-card__title").map(&:text))
.to eq(
[
"Client age",
"Level of help",
],
)
end
end

it "exits early if means are aggregated certificated work" do
it "exits early if means are aggregated for controlled work" do
fill_in_client_age_screen(choice: "Under 18")
fill_in_level_of_help_screen(choice: "Civil controlled work or family mediation")
fill_in_under_18_controlled_legal_rep_screen(choice: "No")
Expand Down

0 comments on commit f0ecdac

Please sign in to comment.