diff --git a/spec/models/verification/management/document_spec.rb b/spec/models/verification/management/document_spec.rb index 07732e7de..076c68b67 100644 --- a/spec/models/verification/management/document_spec.rb +++ b/spec/models/verification/management/document_spec.rb @@ -2,18 +2,18 @@ require 'rails_helper' describe Verification::Management::Document do describe "#valid_age?" do - it "returns false when the user is younger than sixteen years old" do - census_response = double(date_of_birth: Date.new(16.years.ago.year, 12, 31)) + it "returns false when the user is younger than the user's minimum required age" do + census_response = double(date_of_birth: Date.new(User.minimum_required_age.years.ago.year, 12, 31)) expect(Verification::Management::Document.new.valid_age?(census_response)).to be false end - it "returns true when the user is sixteen years old" do - census_response = double(date_of_birth: Date.new(16.years.ago.year, 16.years.ago.month, 16.years.ago.day)) + it "returns true when the user has the user's minimum required age" do + census_response = double(date_of_birth: Date.new(User.minimum_required_age.years.ago.year, 16.years.ago.month, 16.years.ago.day)) expect(Verification::Management::Document.new.valid_age?(census_response)).to be true end - it "returns true when the user is older than sixteen years old" do - census_response = double(date_of_birth: Date.new(33.years.ago.year, 12, 31)) + it "returns true when the user is older than the user's minimum required age" do + census_response = double(date_of_birth: Date.new((User.minimum_required_age + 10).years.ago.year, 12, 31)) expect(Verification::Management::Document.new.valid_age?(census_response)).to be true end end