require File.dirname(__FILE__) + '/../spec_helper' describe UserMailer do before(:each) do @valid_options = { :to_name => 'Test User', :to_email => 'Test@UserName.com', :token => "test_token" } end describe "welcome message" do it "should include direct link to activate the account" do mail = UserMailer.deliver_welcome_message(@valid_options) mail.body.should =~ /Hello Test User,/ end it "should include direct link to create a password" do RulesEngine::ControllerUserMail.host = "my.server.name" mail = UserMailer.deliver_welcome_message(@valid_options) mail.body.should =~ /http:\/\/my.server.name\/user\/pswd_reset\?token=test_token/ end end describe "forgot password" do it "should include direct link to activate the account" do mail = UserMailer.deliver_forgot_password(@valid_options) mail.body.should =~ /Hello Test User,/ end it "should include direct link to create a password" do RulesEngine::ControllerUserMail.host = "my.server.name" mail = UserMailer.deliver_forgot_password(@valid_options) mail.body.should =~ /http:\/\/my.server.name\/user\/pswd_reset\?token=test_token/ end end end