diff --git a/spec/models/verification/management/document_spec.rb b/spec/models/verification/management/document_spec.rb index 8a43a49fd..78d41c486 100644 --- a/spec/models/verification/management/document_spec.rb +++ b/spec/models/verification/management/document_spec.rb @@ -75,43 +75,43 @@ 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) do + let(:min_age) { User.minimum_required_age } + let(:over_minimum_age_date_of_birth) { Date.new((min_age + 10).years.ago.year, 12, 31) } + let(:under_minimum_age_date_of_birth) { Date.new(min_age.years.ago.year, 12, 31) } + let(:just_minimum_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 = double(date_of_birth: under_minium_age_date_of_birth) + census_response = double(date_of_birth: under_minimum_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 = double(date_of_birth: just_minium_age_date_of_birth) + census_response = double(date_of_birth: just_minimum_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 = double(date_of_birth: over_minium_age_date_of_birth) + census_response = double(date_of_birth: over_minimum_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 = double(date_of_birth: under_minium_age_date_of_birth) + census_response = double(date_of_birth: under_minimum_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 = double(date_of_birth: just_minium_age_date_of_birth) + census_response = double(date_of_birth: just_minimum_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 = double(date_of_birth: over_minium_age_date_of_birth) + census_response = double(date_of_birth: over_minimum_age_date_of_birth) expect(Verification::Management::Document.new.under_age?(census_response)).to be false end end