Sha256: 60b641d0492cbcddb8fb1c225abc45ebf5b14d09b7c64df316a05a32bf0af7af

Contents?: true

Size: 904 Bytes

Versions: 7

Compression:

Stored size: 904 Bytes

Contents

require 'test_helper'

class DoubleCompileTest < ActionMailer::TestCase

  def test_rendering_the_same_layout_twice_works
    email = UserNoLayoutMailer.welcome.deliver_now
    assert !ActionMailer::Base.deliveries.empty?
    # Test the body of the sent email contains what we expect it to

    body_contents = /<h2 id="welcome">Welcome!<\/h2>/
    assert_match body_contents,       email.html_part.body.to_s

    body_contents = /## Welcome!/
    assert_match body_contents,       email.text_part.body.to_s

    email = UserNoLayoutMailer.welcome.deliver_now
    assert !ActionMailer::Base.deliveries.empty?
    # Test the body of the sent email contains what we expect it to

    body_contents = /<h2 id="welcome">Welcome!<\/h2>/
    assert_match body_contents,       email.html_part.body.to_s

    body_contents = /## Welcome!/
    assert_match body_contents,       email.text_part.body.to_s
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
maildown-3.3.1 test/integration/double_compile_test.rb
maildown-3.3.0 test/integration/double_compile_test.rb
maildown-3.2.0 test/integration/double_compile_test.rb
maildown-3.1.0 test/integration/double_compile_test.rb
maildown-3.0.3 test/integration/double_compile_test.rb
maildown-3.0.2 test/integration/double_compile_test.rb
maildown-3.0.1 test/integration/double_compile_test.rb