Skip to content

Commit

Permalink
Add some basic email specs
Browse files Browse the repository at this point in the history
  • Loading branch information
cycomachead committed Jul 8, 2024
1 parent a25cff0 commit bf0e167
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions spec/models/email_template_spec.rb
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

0 comments on commit bf0e167

Please sign in to comment.