Skip to content

Commit

Permalink
Add specs testing the behavior of the Reply-To header on sent mails.
Browse files Browse the repository at this point in the history
Signed-off-by: Radiant CMS dev team <radiant@prime-motif.com>
  • Loading branch information
moklett authored and Radiant CMS dev team committed Feb 12, 2009
1 parent 10c198c commit 9a1c9a3
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions spec/models/mail_spec.rb
Expand Up @@ -149,6 +149,24 @@
@mail.send.should be_false
@mail.errors['base'].should == "Boom!"
end

it "should set the Reply-To header on the sent mail to the reply_to value given in the configuration" do
@mail.config[:reply_to] = "reply_to@example.com"
@mail.send
ActionMailer::Base.deliveries.last.reply_to.should == [@mail.config[:reply_to]] # reply_to on TMail is an Array
end

it "should set the Reply-To header on the sent mail to the reply_to_field data value given in the configuration" do
@mail.config[:reply_to_field] = 'email'
@mail.data['email'] = 'reply_to_field@example.com'
@mail.send
ActionMailer::Base.deliveries.last.reply_to.should == [@mail.data['email']] # reply_to on TMail is an Array
end

it "should set the Reply-To header on the sent mail to the from value when the configuration does not specify a reply_to" do
@mail.send
ActionMailer::Base.deliveries.last.reply_to.should == ['foo@baz.com'] # reply_to on TMail is an Array
end

describe "when the page has no email body specified" do
it "should render the submitted data as YAML to the plain body" do
Expand Down

0 comments on commit 9a1c9a3

Please sign in to comment.