Skip to content
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
10 changes: 0 additions & 10 deletions app/models/profile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,21 +90,11 @@ def self.build_compound_pii(pii)
values.join(':')
end

def includes_liveness_check?
return false if proofing_components.blank?
proofing_components['liveness_check'].present?
end

def includes_phone_check?
return false if proofing_components.blank?
proofing_components['address_check'] == 'lexis_nexis_address'
end

def strict_ial2_proofed?
return false unless active
includes_liveness_check?
end

def has_proofed_before?
Profile.where(user_id: user_id).where.not(activated_at: nil).where.not(id: self.id).exists?
end
Expand Down
42 changes: 0 additions & 42 deletions spec/models/profile_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,26 +46,6 @@
end
end

describe '#includes_liveness_check?' do
it 'returns true if a component for liveness is present' do
profile = create(:profile, proofing_components: { liveness_check: 'acuant' })

expect(profile.includes_liveness_check?).to eq(true)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are changes to the model file itself missing?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

huh, yes they are. idk how i managed to not check those in

end

it 'returns false if a component for liveness is not present' do
profile = create(:profile, proofing_components: { liveness_check: nil })

expect(profile.includes_liveness_check?).to eq(false)
end

it 'returns false if proofing_components is blank' do
profile = create(:profile, proofing_components: '')

expect(profile.includes_liveness_check?).to eq(false)
end
end

describe '#includes_phone_check?' do
it 'returns true if the address_check component is lexis_nexis_address' do
profile = create(:profile, proofing_components: { address_check: 'lexis_nexis_address' })
Expand All @@ -86,28 +66,6 @@
end
end

describe '#strict_ial2_proofed?' do
it 'returns false if the profile is not active' do
profile = create(:profile, active: false)

expect(profile.strict_ial2_proofed?).to eq(false)
end

it 'returns true if the profile does have liveness' do
proofing_components = { liveness_check: :acuant }
profile = create(:profile, :active, proofing_components: proofing_components)

expect(profile.strict_ial2_proofed?).to eq(true)
end

it 'returns false if the profile does not have liveness' do
proofing_components = { liveness_check: nil }
profile = create(:profile, :active, proofing_components: proofing_components)

expect(profile.strict_ial2_proofed?).to eq(false)
end
end

describe '#encrypt_pii' do
subject(:encrypt_pii) { profile.encrypt_pii(pii, user.password) }

Expand Down