From bb50f02ba1b6a871dcd88f6a8bd342825020affc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Wed, 6 Nov 2024 15:27:21 +0100 Subject: [PATCH] Replace instance_double usages with double After the previous commit, we were using `double` in many places but were only using `instance_double` in one file. So, for consistency, we're using `double` in this file as well. --- .../verification/management/document_spec.rb | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/spec/models/verification/management/document_spec.rb b/spec/models/verification/management/document_spec.rb index e9eb02552..8a43a49fd 100644 --- a/spec/models/verification/management/document_spec.rb +++ b/spec/models/verification/management/document_spec.rb @@ -84,40 +84,34 @@ describe Verification::Management::Document do 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 = double(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 = double(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 = double(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 = double(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 = double(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 = double(date_of_birth: over_minium_age_date_of_birth) expect(Verification::Management::Document.new.under_age?(census_response)).to be false end end