Skip to content

Commit

Permalink
fix email template spec
Browse files Browse the repository at this point in the history
  • Loading branch information
cycomachead committed Jul 22, 2024
1 parent e77873a commit 7260aa1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spec/models/email_template_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
require "rails_helper"

RSpec.describe EmailTemplate, type: :model do
describe "#reason?" do
describe "#accepts_custom_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)
expect(template.accepts_custom_reason?).to be_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)
expect(template.accepts_custom_reason?).to be_true
end

it "returns false if no reason is in the body" do
template = EmailTemplate.new
expect(template.reason?).to eq(false)
expect(template.accepts_custom_reason?).to be_false
end
end
end

0 comments on commit 7260aa1

Please sign in to comment.