-
-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A generic case reference ID generator for use in email Subject lines to prevent incorrect threading by mail clients, and/or to use in the Body for end user ease of reference.
- Loading branch information
1 parent
53fa606
commit 576fbd6
Showing
2 changed files
with
36 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
require 'spec_helper' | ||
|
||
RSpec.describe MailerHelper do | ||
include MailerHelper | ||
|
||
describe '#case_reference' do | ||
context 'with the default prefix' do | ||
subject { case_reference } | ||
it { is_expected.to match(/CASE\/\d{8}-[A-Z0-9]{4}/) } | ||
end | ||
|
||
context 'with a custom prefix' do | ||
subject { case_reference('HELP') } | ||
it { is_expected.to match(/HELP\/\d{8}-[A-Z0-9]{4}/) } | ||
end | ||
end | ||
end |