-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OTP email now personalises with journey name
- Loading branch information
Showing
8 changed files
with
34 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -334,7 +334,7 @@ class SomePolicy; end | |
describe "#email_verification" do | ||
it "raises error" do | ||
expect { | ||
ClaimMailer.email_verification(claim, nil).deliver! | ||
ClaimMailer.email_verification(claim, nil, "some journey").deliver! | ||
}.to raise_error(ArgumentError, "Unknown claim policy: SomePolicy") | ||
end | ||
end | ||
|
@@ -349,7 +349,7 @@ class SomePolicy; end | |
end | ||
|
||
describe "#email_verification" do | ||
let(:mail) { ClaimMailer.email_verification(claim, one_time_password) } | ||
let(:mail) { ClaimMailer.email_verification(claim, one_time_password, "some journey") } | ||
let(:one_time_password) { 123124 } | ||
let(:claim) { build(:claim, policy: policy, first_name: "Ellie", email_address: "[email protected]") } | ||
|
||
|
@@ -359,7 +359,13 @@ class SomePolicy; end | |
let(:policy) { Policies::EarlyCareerPayments } | ||
|
||
it "has personalisation keys for: one time password, validity_duration,first_name and support_email_address" do | ||
expect(mail[:personalisation].decoded).to eq("{:email_subject=>\"Early-career payment email verification\", :first_name=>\"Ellie\", :one_time_password=>123124, :support_email_address=>\"[email protected]\", :validity_duration=>\"15 minutes\"}") | ||
expect(mail.personalisation.keys.sort).to eql([:email_subject, :first_name, :journey_name, :one_time_password, :support_email_address, :validity_duration]) | ||
expect(mail.personalisation[:email_subject]).to eql("Early-career payment email verification") | ||
expect(mail.personalisation[:first_name]).to eql("Ellie") | ||
expect(mail.personalisation[:journey_name]).to eql("some journey") | ||
expect(mail.personalisation[:one_time_password]).to eql(123124) | ||
expect(mail.personalisation[:support_email_address]).to eql("[email protected]") | ||
expect(mail.personalisation[:validity_duration]).to eql("15 minutes") | ||
expect(mail.body).to be_empty | ||
end | ||
end | ||
|
@@ -368,7 +374,13 @@ class SomePolicy; end | |
let(:policy) { Policies::LevellingUpPremiumPayments } | ||
|
||
it "has personalisation keys for: one time password, validity_duration,first_name and support_email_address" do | ||
expect(mail[:personalisation].decoded).to eq("{:email_subject=>\"School targeted retention incentive email verification\", :first_name=>\"Ellie\", :one_time_password=>123124, :support_email_address=>\"[email protected]\", :validity_duration=>\"15 minutes\"}") | ||
expect(mail.personalisation.keys.sort).to eql([:email_subject, :first_name, :journey_name, :one_time_password, :support_email_address, :validity_duration]) | ||
expect(mail.personalisation[:email_subject]).to eql("School targeted retention incentive email verification") | ||
expect(mail.personalisation[:first_name]).to eql("Ellie") | ||
expect(mail.personalisation[:journey_name]).to eql("some journey") | ||
expect(mail.personalisation[:one_time_password]).to eql(123124) | ||
expect(mail.personalisation[:support_email_address]).to eql("[email protected]") | ||
expect(mail.personalisation[:validity_duration]).to eql("15 minutes") | ||
expect(mail.body).to be_empty | ||
end | ||
end | ||
|