Skip to content

Commit

Permalink
Merge pull request #7026 from alphagov/dependabot/bundler/erb_lint-0.8.0
Browse files Browse the repository at this point in the history
Bump erb_lint from 0.7.0 to 0.8.0
  • Loading branch information
mtaylorgds authored and baisa committed Jan 9, 2025
2 parents 02eacab + 0d03928 commit 7c6b5b7
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 112 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ GEM
docile (1.4.0)
domain_name (0.6.20240107)
drb (2.2.1)
erb_lint (0.7.0)
erb_lint (0.8.0)
activesupport
better_html (>= 2.0.1)
parser (>= 2.7.1.4)
Expand Down
29 changes: 15 additions & 14 deletions app/flows/check_uk_visa_flow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,10 @@ def define
end
elsif calculator.staying_for_six_months_or_less?
if calculator.study_visit?
if calculator.passport_country_requires_electronic_travel_authorisation?
outcome :outcome_study_electronic_travel_authorisation
elsif calculator.passport_country_is_taiwan?
if calculator.passport_country_is_taiwan?
outcome :outcome_study_waiver_taiwan
elsif calculator.passport_country_requires_electronic_travel_authorisation?
outcome :outcome_study_electronic_travel_authorisation
elsif calculator.passport_country_in_direct_airside_transit_visa_list? ||
calculator.passport_country_in_visa_national_list? ||
calculator.travel_document?
Expand All @@ -209,10 +209,11 @@ def define
outcome :outcome_study_no_visa_needed # outcome 1 no visa needed
end
elsif calculator.work_visit?
if calculator.passport_country_requires_electronic_travel_authorisation?
if calculator.passport_country_is_taiwan?
outcome :outcome_work_n
elsif calculator.passport_country_requires_electronic_travel_authorisation?
outcome :outcome_work_electronic_travel_authorisation
elsif (calculator.passport_country_in_british_overseas_territories_list? ||
calculator.passport_country_is_taiwan? ||
calculator.passport_country_in_non_visa_national_list? ||
calculator.passport_country_in_eea?) &&
!calculator.travel_document?
Expand Down Expand Up @@ -341,10 +342,10 @@ def travel_response_next_route(node)
end

if calculator.school_visit?
if calculator.passport_country_requires_electronic_travel_authorisation?
next outcome(:outcome_school_electronic_travel_authorisation)
elsif calculator.passport_country_is_taiwan?
if calculator.passport_country_is_taiwan?
next outcome(:outcome_study_waiver_taiwan)
elsif calculator.passport_country_requires_electronic_travel_authorisation?
next outcome(:outcome_school_electronic_travel_authorisation)
elsif calculator.passport_country_in_non_visa_national_list? || calculator.passport_country_in_british_overseas_territories_list? || calculator.passport_country_in_eea?
next outcome(:outcome_school_n)
else
Expand All @@ -353,10 +354,10 @@ def travel_response_next_route(node)
end

if calculator.medical_visit?
if calculator.passport_country_requires_electronic_travel_authorisation?
next outcome(:outcome_medical_electronic_travel_authorisation)
elsif calculator.passport_country_is_taiwan?
if calculator.passport_country_is_taiwan?
next outcome(:outcome_visit_waiver_taiwan)
elsif calculator.passport_country_requires_electronic_travel_authorisation?
next outcome(:outcome_medical_electronic_travel_authorisation)
elsif (calculator.passport_country_in_non_visa_national_list? ||
calculator.passport_country_in_eea? ||
calculator.passport_country_in_british_overseas_territories_list?) &&
Expand All @@ -368,10 +369,10 @@ def travel_response_next_route(node)
end

if calculator.tourism_visit?
if calculator.passport_country_requires_electronic_travel_authorisation?
next outcome(:outcome_tourism_electronic_travel_authorisation)
elsif calculator.passport_country_is_taiwan?
if calculator.passport_country_is_taiwan?
next outcome(:outcome_visit_waiver_taiwan)
elsif calculator.passport_country_requires_electronic_travel_authorisation?
next outcome(:outcome_tourism_electronic_travel_authorisation)
elsif (calculator.passport_country_in_non_visa_national_list? ||
calculator.passport_country_in_eea? ||
calculator.passport_country_in_british_overseas_territories_list?) &&
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<% if calculator.passport_country_in_eta_rollout_group_1_rest_of_the_world? %>
^If you’re travelling on or after 8 January 2025, you’ll need to apply for an [electronic travel authorisation (ETA)](/guidance/apply-for-an-electronic-travel-authorisation-eta).
<% elsif calculator.passport_country_in_eta_rollout_group_2_eu_eea? %>
<% if calculator.passport_country_in_eta_rollout_group_2_eu_eea? %>
^If you’re travelling on or after 2 April 2025, you’ll need to apply for an [electronic travel authorisation (ETA)](/guidance/apply-for-an-electronic-travel-authorisation-eta). You’ll be able to apply from 5 March 2025.
<% end %>
111 changes: 52 additions & 59 deletions lib/smart_answer/calculators/uk_visa_calculator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,6 @@ def passport_country_in_british_national_overseas_list?
COUNTRY_GROUP_BRITISH_NATIONAL_OVERSEAS.include?(@passport_country)
end

def passport_country_in_eta_rollout_group_1_rest_of_the_world?
COUNTRY_GROUP_ETA_ROLLOUT_GROUP_1_REST_OF_THE_WORLD.include?(@passport_country)
end

def passport_country_in_eta_rollout_group_2_eu_eea?
COUNTRY_GROUP_ETA_ROLLOUT_GROUP_2_EU_EEA.include?(@passport_country)
end
Expand Down Expand Up @@ -553,12 +549,63 @@ def show_colombia_visa_change_transition_text?
].freeze

COUNTRY_GROUP_ELECTRONIC_TRAVEL_AUTHORISATION = %w[
qatar
antigua-and-barbuda
argentina
australia
bahamas
bahrain
barbados
belize
botswana
brazil
british-national-overseas
brunei
canada
chile
colombia
costa-rica
federated-states-of-micronesia
grenada
guatemala
guyana
hong-kong
hong-kong-(british-national-overseas)
israel
japan
kiribati
kuwait
macao
malaysia
maldives
marshall-islands
mauritius
mexico
nauru
new-zealand
nicaragua
oman
palau
panama
papua-new-guinea
paraguay
peru
qatar
samoa
saudi-arabia
seychelles
singapore
solomon-islands
south-korea
st-kitts-and-nevis
st-lucia
st-vincent-and-the-grenadines
taiwan
tonga
trinidad-and-tobago
tuvalu
united-arab-emirates
uruguay
usa
].freeze

COUNTRY_GROUP_EPASSPORT_GATES = %w[
Expand Down Expand Up @@ -630,60 +677,6 @@ def show_colombia_visa_change_transition_text?
"zimbabwe",
].flatten.freeze

COUNTRY_GROUP_ETA_ROLLOUT_GROUP_1_REST_OF_THE_WORLD = %w[
antigua-and-barbuda
argentina
australia
bahamas
barbados
belize
botswana
brazil
british-national-overseas
brunei
canada
chile
colombia
costa-rica
federated-states-of-micronesia
grenada
guatemala
guyana
hong-kong
hong-kong-(british-national-overseas)
israel
japan
kiribati
macao
malaysia
maldives
marshall-islands
mauritius
mexico
nauru
new-zealand
nicaragua
palau
panama
papua-new-guinea
paraguay
peru
samoa
seychelles
singapore
solomon-islands
south-korea
st-kitts-and-nevis
st-lucia
st-vincent-and-the-grenadines
taiwan
tonga
trinidad-and-tobago
tuvalu
uruguay
usa
].freeze

COUNTRY_GROUP_ETA_ROLLOUT_GROUP_2_EU_EEA = %w[
andorra
austria
Expand Down
56 changes: 27 additions & 29 deletions test/flows/check_uk_visa_flow_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@ class CheckUkVisaFlowTest < ActiveSupport::TestCase
@british_overseas_territory_country = "anguilla"
@non_visa_national_country = "andorra"
@eea_country = "austria"
@eta_rollout_group_1_rest_of_the_world_country = "antigua-and-barbuda"
@eta_rollout_group_2_eu_eea_country = "bonaire-st-eustatius-saba"
@travel_document_country = "hong-kong"
@b1_b2_country = "syria"
@youth_mobility_scheme_country = "canada"

@non_visa_national_eta_text = "You currently do not need an electronic travel authorisation (ETA)"
@eta_rollout_group_1_rest_of_the_world_text = "If you’re travelling on or after 8 January 2025, you’ll need to apply for an electronic travel authorisation (ETA)."
@electronic_travel_authorisation_text = "You'll need an electronic travel authorisation (ETA) or a visa"
@eta_rollout_group_2_eu_eea_text = "If you’re travelling on or after 2 April 2025, you’ll need to apply for an electronic travel authorisation (ETA). You’ll be able to apply from 5 March 2025."
@eea_eta_text = "You currently do not need an electronic travel authorisation (ETA)"

Expand All @@ -48,7 +47,6 @@ class CheckUkVisaFlowTest < ActiveSupport::TestCase
@travel_document_country,
@b1_b2_country,
@youth_mobility_scheme_country,
@eta_rollout_group_1_rest_of_the_world_country,
@eta_rollout_group_2_eu_eea_country].uniq)
end

Expand Down Expand Up @@ -425,11 +423,11 @@ class CheckUkVisaFlowTest < ActiveSupport::TestCase
assert_next_node :outcome_study_m, for_response: "six_months_or_less"
end

should "have a next node of outcome_study_m for a study visit with a travel document" do
should "have a next node of outcome_study_electronic_travel_authorisation for a study visit with a travel document" do
add_responses what_passport_do_you_have?: @travel_document_country,
what_sort_of_travel_document?: "travel_document",
purpose_of_visit?: "study"
assert_next_node :outcome_study_m, for_response: "six_months_or_less"
assert_next_node :outcome_study_electronic_travel_authorisation, for_response: "six_months_or_less"
end

should "have a next node of outcome_study_no_visa_needed for a study visit with a British overseas " \
Expand Down Expand Up @@ -945,9 +943,9 @@ class CheckUkVisaFlowTest < ActiveSupport::TestCase
assert_no_rendered_outcome text: "Whether you need a visa depends"
end

should "render callout box for eta_rollout_group_1_rest_of_the_world_country passport holders" do
add_responses what_passport_do_you_have?: @eta_rollout_group_1_rest_of_the_world_country
assert_rendered_outcome text: @eta_rollout_group_1_rest_of_the_world_text
should "render callout box for electronic_travel_authorisation_country passport holders" do
add_responses what_passport_do_you_have?: @electronic_travel_authorisation_country
assert_rendered_outcome text: @electronic_travel_authorisation_text
end

should "render callout box for eta_rollout_group_2_eu_eea_country passport holders" do
Expand All @@ -969,9 +967,9 @@ class CheckUkVisaFlowTest < ActiveSupport::TestCase
assert_no_rendered_outcome text: @eea_eta_text
end

should "render callout box for eta_rollout_group_1_rest_of_the_world_country passport holders" do
add_responses what_passport_do_you_have?: @eta_rollout_group_1_rest_of_the_world_country
assert_rendered_outcome text: @eta_rollout_group_1_rest_of_the_world_text
should "render callout box for electronic_travel_authorisation_country passport holders" do
add_responses what_passport_do_you_have?: @electronic_travel_authorisation_country
assert_rendered_outcome text: @electronic_travel_authorisation_text
end

should "render callout box for eta_rollout_group_2_eu_eea_country passport holders" do
Expand All @@ -993,9 +991,9 @@ class CheckUkVisaFlowTest < ActiveSupport::TestCase
assert_no_rendered_outcome text: @eea_eta_text
end

should "render callout box for eta_rollout_group_1_rest_of_the_world_country passport holders" do
add_responses what_passport_do_you_have?: @eta_rollout_group_1_rest_of_the_world_country
assert_rendered_outcome text: @eta_rollout_group_1_rest_of_the_world_text
should "render callout box for electronic_travel_authorisation_country passport holders" do
add_responses what_passport_do_you_have?: @electronic_travel_authorisation_country
assert_rendered_outcome text: @electronic_travel_authorisation_text
end

should "render callout box for eta_rollout_group_2_eu_eea_country passport holders" do
Expand All @@ -1017,9 +1015,9 @@ class CheckUkVisaFlowTest < ActiveSupport::TestCase
assert_no_rendered_outcome text: @eea_eta_text
end

should "render callout box for eta_rollout_group_1_rest_of_the_world_country passport holders" do
add_responses what_passport_do_you_have?: @eta_rollout_group_1_rest_of_the_world_country
assert_rendered_outcome text: @eta_rollout_group_1_rest_of_the_world_text
should "render callout box for electronic_travel_authorisation_country passport holders" do
add_responses what_passport_do_you_have?: @electronic_travel_authorisation_country
assert_rendered_outcome text: @electronic_travel_authorisation_text
end

should "render callout box for eta_rollout_group_2_eu_eea_country passport holders" do
Expand All @@ -1040,9 +1038,9 @@ class CheckUkVisaFlowTest < ActiveSupport::TestCase
assert_no_rendered_outcome text: @eea_eta_text
end

should "render callout box for eta_rollout_group_1_rest_of_the_world_country passport holders" do
add_responses what_passport_do_you_have?: @eta_rollout_group_1_rest_of_the_world_country
assert_rendered_outcome text: @eta_rollout_group_1_rest_of_the_world_text
should "render callout box for electronic_travel_authorisation_country passport holders" do
add_responses what_passport_do_you_have?: @electronic_travel_authorisation_country
assert_rendered_outcome text: @electronic_travel_authorisation_text
end

should "render callout box for eta_rollout_group_2_eu_eea_country passport holders" do
Expand All @@ -1063,9 +1061,9 @@ class CheckUkVisaFlowTest < ActiveSupport::TestCase
assert_no_rendered_outcome text: @eea_eta_text
end

should "render callout box for eta_rollout_group_1_rest_of_the_world_country passport holders" do
add_responses what_passport_do_you_have?: @eta_rollout_group_1_rest_of_the_world_country
assert_rendered_outcome text: @eta_rollout_group_1_rest_of_the_world_text
should "render callout box for electronic_travel_authorisation_country passport holders" do
add_responses what_passport_do_you_have?: @electronic_travel_authorisation_country
assert_rendered_outcome text: @electronic_travel_authorisation_text
end

should "render callout box for eta_rollout_group_2_eu_eea_country passport holders" do
Expand All @@ -1086,9 +1084,9 @@ class CheckUkVisaFlowTest < ActiveSupport::TestCase
assert_no_rendered_outcome text: @eea_eta_text
end

should "render callout box for eta_rollout_group_1_rest_of_the_world_country passport holders" do
add_responses what_passport_do_you_have?: @eta_rollout_group_1_rest_of_the_world_country
assert_rendered_outcome text: @eta_rollout_group_1_rest_of_the_world_text
should "render callout box for electronic_travel_authorisation_country passport holders" do
add_responses what_passport_do_you_have?: @electronic_travel_authorisation_country
assert_rendered_outcome text: @electronic_travel_authorisation_text
end

should "render callout box for eta_rollout_group_2_eu_eea_country passport holders" do
Expand All @@ -1110,9 +1108,9 @@ class CheckUkVisaFlowTest < ActiveSupport::TestCase
assert_no_rendered_outcome text: @eea_eta_text
end

should "render callout box for eta_rollout_group_1_rest_of_the_world_country passport holders" do
add_responses what_passport_do_you_have?: @eta_rollout_group_1_rest_of_the_world_country
assert_rendered_outcome text: @eta_rollout_group_1_rest_of_the_world_text
should "render callout box for electronic_travel_authorisation_country passport holders" do
add_responses what_passport_do_you_have?: @electronic_travel_authorisation_country
assert_rendered_outcome text: @electronic_travel_authorisation_text
end

should "render callout box for eta_rollout_group_2_eu_eea_country passport holders" do
Expand Down
12 changes: 6 additions & 6 deletions test/support/flows/check_uk_visa_flow_test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,16 @@ def test_shared_purpose_of_visit_next_nodes
assert_next_node :outcome_medical_n, for_response: "medical"
end

should "have a next node of outcome_medical_n for a travel document country with a passport" do
should "have a next node of outcome_medical_electronic_travel_authorisationfor a travel document country with a passport" do
add_responses what_passport_do_you_have?: @travel_document_country,
what_sort_of_travel_document?: "passport"
assert_next_node :outcome_medical_n, for_response: "medical"
assert_next_node :outcome_medical_electronic_travel_authorisation, for_response: "medical"
end

should "have a next node of outcome_medical_y for a travel document country with a travel document" do
should "have a next node of outcome_medical_electronic_travel_authorisation for a travel document country with a travel document" do
add_responses what_passport_do_you_have?: @travel_document_country,
what_sort_of_travel_document?: "travel_document"
assert_next_node :outcome_medical_y, for_response: "medical"
assert_next_node :outcome_medical_electronic_travel_authorisation, for_response: "medical"
end

should "have a next node of outcome_medical_y for other passports" do
Expand Down Expand Up @@ -176,10 +176,10 @@ def test_shared_purpose_of_visit_next_nodes
assert_next_node :outcome_tourism_n, for_response: "tourism"
end

should "have a next node of outcome_tourism_n for a travel document country with a passport" do
should "have a next node of outcome_tourism_electronic_travel_authorisation for a travel document country with a passport" do
add_responses what_passport_do_you_have?: @travel_document_country,
what_sort_of_travel_document?: "passport"
assert_next_node :outcome_tourism_n, for_response: "tourism"
assert_next_node :outcome_tourism_electronic_travel_authorisation, for_response: "tourism"
end

should "have a next node of outcome_tourism_y for a travel document country with a travel document" do
Expand Down

0 comments on commit 7c6b5b7

Please sign in to comment.