Skip to content
This repository was archived by the owner on Jun 12, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/lexisnexis/instant_verify/verification_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ def formatted_address
def date_of_birth
formatter = DateFormatter.new(attributes[:dob])
if attributes[:dob_year_only]
if defined?(LoginGov::Hostdata) && LoginGov::Hostdata.env == 'staging' && defined?(Rails)
Rails.logger.info("sending dob_year_only, uuid=#{uuid}")
end
formatter.formatted_year_only
else
formatter.formatted_date
Expand Down
2 changes: 1 addition & 1 deletion lib/lexisnexis/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module LexisNexis
VERSION = '2.5.0'.freeze
VERSION = '2.5.1.pre'.freeze
end
17 changes: 17 additions & 0 deletions spec/lib/instant_verify/verification_request_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'logger'

describe LexisNexis::InstantVerify::VerificationRequest do
let(:attributes) do
{
Expand Down Expand Up @@ -59,6 +61,21 @@
date_of_birth = JSON.parse(subject.body, symbolize_names: true).dig(:Person, :DateOfBirth)
expect(date_of_birth).to_not include(:Month, :Day)
end

context 'when deployed in staging' do
let(:logger) { Logger.new('/dev/null') }

before do
stub_const('LoginGov::Hostdata', double(env: 'staging'))
stub_const('Rails', double(logger: logger))
end

it 'logs that it sent dob_year_only' do
expect(logger).to receive(:info).with(/dob_year_only/)

subject
end
end
end
end

Expand Down