Apply Layout/LineLength rubocop rule

Note we're excluding a few files:

* Configuration files that weren't generated by us
* Migration files that weren't generated by us
* The Gemfile, since it includes an important comment that must be on
  the same line as the gem declaration
* The Budget::Stats class, since the heading statistics are a mess and
  having shorter lines would require a lot of refactoring
This commit is contained in:
Javi Martín
2023-07-19 21:37:59 +02:00
parent 75d2782061
commit a1439d0790
156 changed files with 1330 additions and 503 deletions

View File

@@ -75,41 +75,49 @@ describe Verification::Management::Document do
end
describe "Allowed Age" do
let(:min_age) { User.minimum_required_age }
let(:over_minium_age_date_of_birth) { Date.new((min_age + 10).years.ago.year, 12, 31) }
let(:under_minium_age_date_of_birth) { Date.new(min_age.years.ago.year, 12, 31) }
let(:just_minium_age_date_of_birth) { Date.new(min_age.years.ago.year, min_age.years.ago.month, min_age.years.ago.day) }
let(:min_age) { User.minimum_required_age }
let(:over_minium_age_date_of_birth) { Date.new((min_age + 10).years.ago.year, 12, 31) }
let(:under_minium_age_date_of_birth) { Date.new(min_age.years.ago.year, 12, 31) }
let(:just_minium_age_date_of_birth) do
Date.new(min_age.years.ago.year, min_age.years.ago.month, min_age.years.ago.day)
end
describe "#valid_age?" do
it "returns false when the user is younger than the user's minimum required age" do
census_response = instance_double("CensusApi::Response", date_of_birth: under_minium_age_date_of_birth)
census_response = instance_double("CensusApi::Response",
date_of_birth: under_minium_age_date_of_birth)
expect(Verification::Management::Document.new.valid_age?(census_response)).to be false
end
it "returns true when the user has the user's minimum required age" do
census_response = instance_double("CensusApi::Response", date_of_birth: just_minium_age_date_of_birth)
census_response = instance_double("CensusApi::Response",
date_of_birth: just_minium_age_date_of_birth)
expect(Verification::Management::Document.new.valid_age?(census_response)).to be true
end
it "returns true when the user is older than the user's minimum required age" do
census_response = instance_double("CensusApi::Response", date_of_birth: over_minium_age_date_of_birth)
census_response = instance_double("CensusApi::Response",
date_of_birth: over_minium_age_date_of_birth)
expect(Verification::Management::Document.new.valid_age?(census_response)).to be true
end
end
describe "#under_age?" do
it "returns true when the user is younger than the user's minimum required age" do
census_response = instance_double("CensusApi::Response", date_of_birth: under_minium_age_date_of_birth)
census_response = instance_double("CensusApi::Response",
date_of_birth: under_minium_age_date_of_birth)
expect(Verification::Management::Document.new.under_age?(census_response)).to be true
end
it "returns false when the user is user's minimum required age" do
census_response = instance_double("CensusApi::Response", date_of_birth: just_minium_age_date_of_birth)
census_response = instance_double("CensusApi::Response",
date_of_birth: just_minium_age_date_of_birth)
expect(Verification::Management::Document.new.under_age?(census_response)).to be false
end
it "returns false when the user is older than user's minimum required age" do
census_response = instance_double("CensusApi::Response", date_of_birth: over_minium_age_date_of_birth)
census_response = instance_double("CensusApi::Response",
date_of_birth: over_minium_age_date_of_birth)
expect(Verification::Management::Document.new.under_age?(census_response)).to be false
end
end