-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement simple forms notification_email_address
- Loading branch information
1 parent
23101f0
commit a8d95f1
Showing
24 changed files
with
292 additions
and
0 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,4 +15,12 @@ | |
expect(described_class.new(data).notification_first_name).to eq 'Veteran' | ||
end | ||
end | ||
|
||
describe '#notification_email_address' do | ||
it 'returns the email address to be used in notifications' do | ||
data = { 'veteran' => { 'email' => '[email protected]' } } | ||
|
||
expect(described_class.new(data).notification_email_address).to eq '[email protected]' | ||
end | ||
end | ||
end |
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 |
---|---|---|
|
@@ -20,4 +20,14 @@ | |
expect(described_class.new(data).notification_first_name).to eq 'Veteran' | ||
end | ||
end | ||
|
||
describe '#notification_email_address' do | ||
let(:data) do | ||
{ 'email_address' => '[email protected]' } | ||
end | ||
|
||
it 'returns the email address to be used in notifications' do | ||
expect(described_class.new(data).notification_email_address).to eq '[email protected]' | ||
end | ||
end | ||
end |
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 |
---|---|---|
|
@@ -140,4 +140,45 @@ | |
end | ||
end | ||
end | ||
|
||
describe '#notification_email_address' do | ||
context 'preparer is veteran' do | ||
let(:data) do | ||
{ | ||
'preparer_type' => 'veteran', | ||
'veteran_email_address' => '[email protected]' | ||
} | ||
end | ||
|
||
it 'returns the veteran email address' do | ||
expect(described_class.new(data).notification_email_address).to eq '[email protected]' | ||
end | ||
end | ||
|
||
context 'preparer is third party veteran' do | ||
let(:data) do | ||
{ | ||
'preparer_type' => 'third-party-veteran', | ||
'veteran_email_address' => '[email protected]' | ||
} | ||
end | ||
|
||
it 'returns the veteran email address' do | ||
expect(described_class.new(data).notification_email_address).to eq '[email protected]' | ||
end | ||
end | ||
|
||
context 'preparer is anything else' do | ||
let(:data) do | ||
{ | ||
'preparer_type' => 'space-alien', | ||
'non_veteran_email_address' => '[email protected]' | ||
} | ||
end | ||
|
||
it 'returns the non-veteran email address' do | ||
expect(described_class.new(data).notification_email_address).to eq '[email protected]' | ||
end | ||
end | ||
end | ||
end |
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 |
---|---|---|
|
@@ -39,4 +39,32 @@ | |
end | ||
end | ||
end | ||
|
||
describe '#notification_email_address' do | ||
context 'preparer is veteran' do | ||
let(:data) do | ||
{ | ||
'authorizer_type' => 'veteran', | ||
'veteran_email' => '[email protected]' | ||
} | ||
end | ||
|
||
it 'returns the veteran email address' do | ||
expect(described_class.new(data).notification_email_address).to eq '[email protected]' | ||
end | ||
end | ||
|
||
context 'preparer is nonVeteran' do | ||
let(:data) do | ||
{ | ||
'authorizer_type' => 'nonVeteran', | ||
'authorizer_email' => '[email protected]' | ||
} | ||
end | ||
|
||
it 'returns the authorizer email address' do | ||
expect(described_class.new(data).notification_email_address).to eq '[email protected]' | ||
end | ||
end | ||
end | ||
end |
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 |
---|---|---|
|
@@ -87,4 +87,32 @@ | |
end | ||
end | ||
end | ||
|
||
describe '#notification_email_address' do | ||
context 'preparer is surviving dependent' do | ||
let(:data) do | ||
{ | ||
'preparer_type' => 'SURVIVING_DEPENDENT', | ||
'surviving_dependent_email' => '[email protected]' | ||
} | ||
end | ||
|
||
it 'returns the surviving dependent email address' do | ||
expect(described_class.new(data).notification_email_address).to eq '[email protected]' | ||
end | ||
end | ||
|
||
context 'preparer is anyone else' do | ||
let(:data) do | ||
{ | ||
'preparer_type' => 'space-alien', | ||
'veteran_email' => '[email protected]' | ||
} | ||
end | ||
|
||
it 'returns the veteran email address' do | ||
expect(described_class.new(data).notification_email_address).to eq '[email protected]' | ||
end | ||
end | ||
end | ||
end |
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 |
---|---|---|
|
@@ -20,4 +20,14 @@ | |
expect(described_class.new(data).notification_first_name).to eq 'Veteran' | ||
end | ||
end | ||
|
||
describe '#notification_email_address' do | ||
let(:data) do | ||
{ 'preparer_email' => '[email protected]' } | ||
end | ||
|
||
it 'returns the email address to be used in notifications' do | ||
expect(described_class.new(data).notification_email_address).to eq '[email protected]' | ||
end | ||
end | ||
end |
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 |
---|---|---|
|
@@ -59,4 +59,49 @@ | |
end | ||
end | ||
end | ||
|
||
describe '#notification_email_address' do | ||
context "preparer's own claim" do | ||
context 'preparer is veteran' do | ||
let(:data) do | ||
{ | ||
'claim_ownership' => 'self', | ||
'claimant_type' => 'veteran', | ||
'veteran_email' => '[email protected]' | ||
} | ||
end | ||
|
||
it 'returns the veteran email address' do | ||
expect(described_class.new(data).notification_email_address).to eq '[email protected]' | ||
end | ||
end | ||
|
||
context 'preparer is not veteran' do | ||
let(:data) do | ||
{ | ||
'claim_ownership' => 'self', | ||
'claimant_type' => 'non-veteran', | ||
'claimant_email' => '[email protected]' | ||
} | ||
end | ||
|
||
it 'returns the claimant email address' do | ||
expect(described_class.new(data).notification_email_address).to eq '[email protected]' | ||
end | ||
end | ||
end | ||
|
||
context 'third party claim' do | ||
let(:data) do | ||
{ | ||
'claim_ownership' => 'third-party', | ||
'witness_email' => '[email protected]' | ||
} | ||
end | ||
|
||
it 'returns the witness email address' do | ||
expect(described_class.new(data).notification_email_address).to eq '[email protected]' | ||
end | ||
end | ||
end | ||
end |
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 |
---|---|---|
|
@@ -20,4 +20,14 @@ | |
expect(described_class.new(data).notification_first_name).to eq 'Veteran' | ||
end | ||
end | ||
|
||
describe '#notification_email_address' do | ||
let(:data) do | ||
{ 'veteran_email' => '[email protected]' } | ||
end | ||
|
||
it 'returns the email address to be used in notifications' do | ||
expect(described_class.new(data).notification_email_address).to eq '[email protected]' | ||
end | ||
end | ||
end |
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 |
---|---|---|
|
@@ -20,4 +20,14 @@ | |
expect(described_class.new(data).notification_first_name).to eq 'Veteran' | ||
end | ||
end | ||
|
||
describe '#notification_email_address' do | ||
let(:data) do | ||
{ 'preparer_email' => '[email protected]' } | ||
end | ||
|
||
it 'returns the email address to be used in notifications' do | ||
expect(described_class.new(data).notification_email_address).to eq '[email protected]' | ||
end | ||
end | ||
end |
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 |
---|---|---|
|
@@ -66,4 +66,14 @@ | |
expect(described_class.new(data).notification_first_name).to eq 'Veteran' | ||
end | ||
end | ||
|
||
describe '#notification_email_address' do | ||
let(:data) do | ||
{ 'veteran' => { 'email' => '[email protected]' } } | ||
end | ||
|
||
it 'returns the email address to be used in notifications' do | ||
expect(described_class.new(data).notification_email_address).to eq '[email protected]' | ||
end | ||
end | ||
end |
Oops, something went wrong.