Sha256: f8e648bae70c21519124e0e7840d8fc54b49f819e59cf2e34dc9a3001a906206

Contents?: true

Size: 868 Bytes

Versions: 17

Compression:

Stored size: 868 Bytes

Contents

require 'test/helper'

class TypusMailerTest < ActiveSupport::TestCase

  def setup
    @user = typus_users(:admin)
    ActionMailer::Base.default_url_options[:host] = 'test.host'
    @response = TypusMailer.deliver_reset_password_link(@user)
  end

  def test_should_verify_email_from_is_defined_by_typus_options
    assert_equal [ Typus::Configuration.options[:email] ], @response.from
  end

  def test_should_verify_email_to_is_typus_user_email
    assert_equal [ @user.email ], @response.to
  end

  def test_should_verify_email_subject
    expected = "[#{Typus::Configuration.options[:app_name]}] Reset password"
    assert_equal expected, @response.subject
  end

  def test_should_verify_email_contains_reset_password_link_with_token
    expected = "http://test.host/admin/reset_password?token=1A2B3C4D5E6F"
    assert_match expected, @response.body
  end

end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
typus-0.9.39 test/unit/typus_mailer_test.rb
typus-0.9.38 test/unit/typus_mailer_test.rb
typus-0.9.37 test/unit/typus_mailer_test.rb
typus-0.9.36 test/unit/typus_mailer_test.rb
typus-0.9.35 test/unit/typus_mailer_test.rb
typus-0.9.34 test/unit/typus_mailer_test.rb
typus-0.9.33 test/unit/typus_mailer_test.rb
typus-0.9.32 test/unit/typus_mailer_test.rb
typus-0.9.31 test/unit/typus_mailer_test.rb
typus-0.9.30 test/unit/typus_mailer_test.rb
typus-0.9.29 test/unit/typus_mailer_test.rb
typus-0.9.28 test/unit/typus_mailer_test.rb
typus-0.9.27 test/unit/typus_mailer_test.rb
typus-0.9.26 test/unit/typus_mailer_test.rb
typus-0.9.25 test/unit/typus_mailer_test.rb
typus-0.9.24 test/unit/typus_mailer_test.rb
typus-0.9.23 test/unit/typus_mailer_test.rb