Sha256: a85f6e85c82c23fc8a20567fc678d2cc8a4285aefef28ec11aee5c3dcca72c84

Contents?: true

Size: 739 Bytes

Versions: 11

Compression:

Stored size: 739 Bytes

Contents

require 'spec_helper'

describe ClearanceMailer do
  before do
    @user  = Factory(:user)
    @user.forgot_password!
    @email = ClearanceMailer.change_password(@user)
  end

  it "should be from DO_NOT_REPLY" do
    Clearance.configuration.mailer_sender.should =~ /#{@email.from[0]}/i
  end

  it "should be sent to user" do
    @email.to.first.should =~ /#{@user.email}/i
  end

  it "should contain a link to edit the user's password" do
    host = ActionMailer::Base.default_url_options[:host]
    regexp = %r{http://#{host}/users/#{@user.id}/password/edit\?token=#{@user.confirmation_token}}
    @email.body.to_s.should =~ regexp
  end

  it "should set its subject" do
    @email.subject.should =~ /Change your password/
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
clearance-0.16.0 spec/mailers/clearance_mailer_spec.rb
clearance-0.15.0 spec/mailers/clearance_mailer_spec.rb
clearance-0.14.0 spec/mailers/clearance_mailer_spec.rb
clearance-0.13.2 spec/mailers/clearance_mailer_spec.rb
clearance-0.13.0 spec/mailers/clearance_mailer_spec.rb
clearance-0.12.0 spec/mailers/clearance_mailer_spec.rb
clearance-0.11.2 spec/mailers/clearance_mailer_spec.rb
clearance-0.11.1 spec/mailers/clearance_mailer_spec.rb
clearance-0.11.0 spec/models/clearance_mailer_spec.rb
clearance-0.10.5 spec/models/clearance_mailer_spec.rb
clearance-0.10.4 spec/models/clearance_mailer_spec.rb