-
Notifications
You must be signed in to change notification settings - Fork 57
/
verification_spec.rb
37 lines (29 loc) · 1.01 KB
/
verification_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe Vye::Verification, type: :model do
let(:user_info) { create(:vye_user_info) }
describe 'create' do
let(:attributes) { FactoryBot.attributes_for(:vye_verification, user_info:) }
it 'creates a record' do
expect do
Vye::Verification.create!(attributes)
end.to change(Vye::Verification, :count).by(1)
end
end
describe 'show todays verifications' do
let!(:verification) { FactoryBot.create(:vye_verification, user_info:) }
before do
ssn = '123456789'
profile = double(ssn:)
find_profile_by_identifier = double(profile:)
service = double(find_profile_by_identifier:)
allow(MPI::Service).to receive(:new).and_return(service)
end
it 'shows todays verifications' do
expect(Vye::Verification.todays_verifications.length).to eq(1)
end
it 'shows todays verification report' do
expect(Vye::Verification.todays_verifications_report).to be_a(String)
end
end
end