Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Rails 7 gem and node #5921

Merged
merged 9 commits into from
Nov 2, 2023
Prev Previous commit
Update i18n handling in tests
A change in rails 7.1 now raises errors when _any_ i18n lookup
fails.  Previously these tests failed because a missing translation
often meant that a negative test would pass, I expect this text
to be missing, paired with a missing translation was a definite fail!

Now that the error is raised, I have replaced the missong, often
moved, translations with the text it _should_ have been confirming
as missing
colinbruce committed Nov 2, 2023
commit 3485c03b54e7e3a8cb75ff98a0cce8b844fe016c
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
RSpec.describe LegalAidApplications::HasEvidenceOfBenefitForm do
subject(:described_form) { described_class.new(params.merge(model: dwp_override)) }

let(:dwp_override) { create(:dwp_override, passporting_benefit: "Valid state benefit") }
let(:dwp_override) { create(:dwp_override, passporting_benefit: "Universal Credit") }
let(:has_evidence_of_benefit) { true }
let(:params) do
{
2 changes: 1 addition & 1 deletion spec/requests/admin_users/sessions_controller_spec.rb
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@

it "shows google login" do
get_session
expect(unescaped_response_body).not_to include(I18n.t(".admin_users.sessions.google_login"))
expect(unescaped_response_body).to include("Log in via google")
end
end
end
Original file line number Diff line number Diff line change
@@ -65,18 +65,18 @@
end

context "when applicant does not have vehicle" do
let(:vehicle) { nil }
let(:vehicles) { [] }
let(:own_vehicle) { false }

it "displays first vehicle question" do
expect(response.body).to include(I18n.t("shared.check_answers.vehicles.providers.own", individual: "your client"))
end

it "does not display other vehicle questions" do
expect(response.body).not_to include(I18n.t("shared.check_answers_vehicles.providers.estimated_value"))
expect(response.body).not_to include(I18n.t("shared.check_answers_vehicles.providers.payment_remaining"))
expect(response.body).not_to include(I18n.t("shared.check_answers_vehicles.providers.purchased_on"))
expect(response.body).not_to include(I18n.t("shared.check_answers_vehicles.providers.used_regularly"))
expect(response.body).not_to include("What is the estimated value of the vehicle?")
colinbruce marked this conversation as resolved.
Show resolved Hide resolved
expect(response.body).not_to include("Are there any payments left on the vehicle?")
expect(response.body).not_to include("The vehicle was bought more than three years ago?")
expect(response.body).not_to include("Is the vehicle in regular use?")
end
end

8 changes: 4 additions & 4 deletions spec/requests/providers/check_passported_answers_spec.rb
Original file line number Diff line number Diff line change
@@ -232,10 +232,10 @@
end

it "does not display other vehicle questions" do
expect(response.body).not_to include(I18n.t("shared.check_answers_vehicles.providers.estimated_value"))
expect(response.body).not_to include(I18n.t("shared.check_answers_vehicles.providers.payment_remaining"))
expect(response.body).not_to include(I18n.t("shared.check_answers_vehicles.providers.purchased_on"))
expect(response.body).not_to include(I18n.t("shared.check_answers_vehicles.providers.used_regularly"))
expect(response.body).not_to include("What is the estimated value of the vehicle?")
expect(response.body).not_to include("Are there any payments left on the vehicle?")
expect(response.body).not_to include("The vehicle was bought more than three years ago?")
expect(response.body).not_to include("Is the vehicle in regular use?")
end
end
end
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@
context "when applicant is employed" do
it "displays correct text" do
expect(unescaped_response_body).to include(I18n.t("shared.employment_income.page_title", name: applicant.full_name))
expect(unescaped_response_body).not_to include(I18n.t("providers.means.employment_incomes.show.hmrc_not_employed"))
expect(unescaped_response_body).not_to match(/You told us .* is not employed/)
end
end
end
Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@

it "does not display expanded details list" do
request
expect(unescaped_response_body).not_to match(I18n.t("shared.forms.types_of_income_form.expanded_explanation.heading"))
expect(unescaped_response_body).not_to match("Why am I being asked this?")
end

context "when the provider is not authenticated" do
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@
end

it "does not display expanded explanation" do
expect(unescaped_response_body).not_to match(I18n.t("shared.forms.types_of_outgoings_form.expanded_explanation.heading"))
expect(unescaped_response_body).not_to match("Why am I being asked this?")
end

context "when the provider is not authenticated" do
Original file line number Diff line number Diff line change
@@ -69,7 +69,7 @@

it "does not display an Add additional outgoing types section" do
get providers_legal_aid_application_outgoings_summary_index_path(legal_aid_application)
expect(response.body).not_to include(I18n.t("citizens.outgoings_summary.add_other_outgoings.add_other_outgoings"))
expect(response.body).not_to include("Add another type of regular payment")
end
end

Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@

it "displays correct text" do
expect(unescaped_response_body).to include(I18n.t("shared.employment_income.page_title", name: partner.full_name))
expect(unescaped_response_body).not_to include(I18n.t("providers.means.employment_incomes.show.hmrc_not_employed"))
expect(unescaped_response_body).not_to match(/You told us .* is not employed/)
end
end
end
Original file line number Diff line number Diff line change
@@ -120,7 +120,7 @@
end

it "does not display the Other income header" do
expect(unescaped_response_body).not_to include I18n.t("providers.submitted_applications.show.other_income")
expect(unescaped_response_body).not_to include "Other income"
end
end