Skip to content

Instantly share code, notes, and snippets.

@uhlenbrock
Created September 25, 2008 14:50
Show Gist options
  • Save uhlenbrock/12832 to your computer and use it in GitHub Desktop.
Save uhlenbrock/12832 to your computer and use it in GitHub Desktop.
class UserMailer < ActionMailer::Base
def signup_notification(user)
setup_email(user)
@subject += "One final step: please activate."
@body[:url] = "http://#{user.site.domain}/activate/#{user.activation_code}"
@body[:code] = user.activation_code
end
end
context "The User Mailer", ActionMailer::TestCase do
tests UserMailer
specify "should send a confirmation on signup" do
response = UserMailer.create_signup_notification(@quentin)
response.subject.should.be "#{user.site.title}: One final step: please activate."
response.body.should.match "http://#{user.site.domain}/activate/#{user.activation_code}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment