-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a25cff0
commit bf0e167
Showing
1 changed file
with
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe EmailTemplate, type: :model do | ||
describe '#reason?' do | ||
it 'returns true if a reason is present in the body' do | ||
template = EmailTemplate.new(body: ' ... {{ denial_reason }}...') | ||
expect(template.reason?).to eq(true) | ||
end | ||
|
||
it 'returns true even if there are other liquid filters' do | ||
template = EmailTemplate.new(body: ' ... {{denial_reason|strip_tags}}...') | ||
expect(template.reason?).to eq(true) | ||
end | ||
|
||
it 'returns false if no reason is in the body' do | ||
template = EmailTemplate.new | ||
expect(template.reason?).to eq(false) | ||
end | ||
end | ||
end |