Sha256: ae6ac02fda1f46787634c36f46594d6d36c5548a5ae0695c22cd0424183cf656

Contents?: true

Size: 1005 Bytes

Versions: 24

Compression:

Stored size: 1005 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

  def test_should_check_email_contains_signature
    assert_match /--\n#{Typus::Configuration.options[:app_name]}/, @response.body
 end

end

Version data entries

24 entries across 24 versions & 2 rubygems

Version Path
fesplugas-typus-0.9.0 test/unit/typus_mailer_test.rb
fesplugas-typus-0.9.1 test/unit/typus_mailer_test.rb
fesplugas-typus-0.9.10 test/unit/typus_mailer_test.rb
fesplugas-typus-0.9.11 test/unit/typus_mailer_test.rb
fesplugas-typus-0.9.12 test/unit/typus_mailer_test.rb
fesplugas-typus-0.9.13 test/unit/typus_mailer_test.rb
fesplugas-typus-0.9.14 test/unit/typus_mailer_test.rb
fesplugas-typus-0.9.15 test/unit/typus_mailer_test.rb
fesplugas-typus-0.9.16 test/unit/typus_mailer_test.rb
fesplugas-typus-0.9.17 test/unit/typus_mailer_test.rb
fesplugas-typus-0.9.2 test/unit/typus_mailer_test.rb
fesplugas-typus-0.9.3 test/unit/typus_mailer_test.rb
fesplugas-typus-0.9.4 test/unit/typus_mailer_test.rb
fesplugas-typus-0.9.5 test/unit/typus_mailer_test.rb
fesplugas-typus-0.9.6 test/unit/typus_mailer_test.rb
fesplugas-typus-0.9.7 test/unit/typus_mailer_test.rb
fesplugas-typus-0.9.8 test/unit/typus_mailer_test.rb
fesplugas-typus-0.9.9 test/unit/typus_mailer_test.rb
typus-0.9.22 test/unit/typus_mailer_test.rb
typus-0.9.21 test/unit/typus_mailer_test.rb