Sha256: 793024341278c79cc44bf738953fea7d4335772ef2141608274eee6e52775db5

Contents?: true

Size: 1.29 KB

Versions: 9

Compression:

Stored size: 1.29 KB

Contents

require "spec_helper"

describe UserMailer do
  let(:user) { build_stubbed(:user) }

  describe "activation_needed_email" do
    let(:mail) { UserMailer.activation_needed_email(user) }

    it "renders the headers" do
      mail.subject.should eq("Welcome to My Awesome Site!")
      mail.to.should eq([user.email])
      mail.from.should eq(['notifications@example.com'])
    end

    it "renders the body" do
      mail.body.encoded.should match("Welcome to")
    end
  end

  describe "activation_success_email" do
    let(:mail) { UserMailer.activation_success_email(user) }

    it "renders the headers" do
      mail.subject.should eq("Your account has been activated!")
      mail.to.should eq([user.email])
      mail.from.should eq(['notifications@example.com'])
    end

    it "renders the body" do
      mail.body.encoded.should match("You have successfully activated")
    end
  end

  describe "reset_password_email" do
    let(:mail) { UserMailer.reset_password_email(user) }

    it "renders the headers" do
      mail.subject.should eq("Password reset requested")
      mail.to.should eq([user.email])
      mail.from.should eq(['notifications@example.com'])
    end

    it "renders the body" do
      mail.body.encoded.should match("You have requested to reset your password.")
    end
  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
raygun-0.0.13 app_prototype/spec/mailers/user_mailer_spec.rb
raygun-0.0.11 templates/_spec/mailers/user_mailer_spec.rb
raygun-0.0.10 templates/_spec/mailers/user_mailer_spec.rb
raygun-0.0.7 templates/_spec/mailers/user_mailer_spec.rb
raygun-0.0.6 templates/_spec/mailers/user_mailer_spec.rb
raygun-0.0.5 templates/_spec/mailers/user_mailer_spec.rb
raygun-0.0.4 templates/_spec/mailers/user_mailer_spec.rb
raygun-0.0.3 templates/_spec/mailers/user_mailer_spec.rb
raygun-0.0.2 templates/_spec/mailers/user_mailer_spec.rb