-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update ATP inbound immigration document information mapping (#518)
- Loading branch information
1 parent
9aa24fc
commit 1ef5e6a
Showing
11 changed files
with
971 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
spec/aca_entities/atp/functions/lawful_presence_determination_builder_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'spec_helper' | ||
require 'aca_entities/atp/functions/lawful_presence_determination_builder' | ||
require "support/atp/inbound_lawful_presence_application" | ||
|
||
RSpec.describe AcaEntities::Atp::Functions::LawfulPresenceDeterminationBuilder do | ||
include_context "inbound_build_application" | ||
let(:cache) { context } | ||
let(:member_id_alien_document) { "IDC1003158" } | ||
let(:member_id_naturalized_citizen) { "IDC1003159" } | ||
let(:member_id_us_citizen) { "IDC1002699" } | ||
let(:member_id_not_lawful) { "IDC1003160" } | ||
let(:subject) { described_class.new } | ||
|
||
describe '#call' do | ||
context 'when member_id is not provided' do | ||
it 'returns "not_lawfully_present_in_us" when no indicators are true' do | ||
expect(subject.call(cache)).to eq('not_lawfully_present_in_us') | ||
end | ||
end | ||
|
||
context 'when member_id is provided' do | ||
it 'returns "alien_lawfully_present" when category code on document is present' do | ||
expect(subject.call(cache, member_id_alien_document)).to eq('alien_lawfully_present') | ||
end | ||
|
||
it 'returns "naturalized_citizen" when naturalized citizen indicator is true' do | ||
expect(subject.call(cache, member_id_naturalized_citizen)).to eq('naturalized_citizen') | ||
end | ||
|
||
it 'returns "us_citizen" when us citizen indicator is true' do | ||
expect(subject.call(cache, member_id_us_citizen)).to eq('us_citizen') | ||
end | ||
|
||
it 'returns "not_lawfully_present_in_us" when no indicators are true' do | ||
expect(subject.call(cache, member_id_not_lawful)).to eq('not_lawfully_present_in_us') | ||
end | ||
end | ||
end | ||
end |
Oops, something went wrong.