File: future_tests.rb

package info (click to toggle)
ruby-premailer 1.14.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 440 kB
  • sloc: ruby: 2,344; makefile: 3
file content (50 lines) | stat: -rw-r--r-- 1,583 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# encoding: UTF-8
require File.expand_path(File.dirname(__FILE__)) + '/helper'

class TestPremailer < Premailer::TestCase
  def test_related_attributes
    flunk 'Not implemented'
    local_setup

    # h1 { text-align: center; }
    assert_equal 'center', @doc.at('h1')['align']

    # td { vertical-align: top; }
    assert_equal 'top', @doc.at('td')['valign']

    # p { vertical-align: top; } -- not allowed
    assert_nil @doc.at('p')['valign']

    # no align attr is specified for <p> elements, so it should not appear
    assert_nil @doc.at('p.unaligned')['align']

    # .contact { background: #9EC03B url("contact_bg.png") repeat 0 0; }
    assert_equal '#9EC03B', @doc.at('td.contact')['bgcolor']

    # body { background-color: #9EBF00; }
    assert_equal '#9EBF00', @doc.at('body')['bgcolor']
  end

  def test_merging_cellpadding
    flunk 'Not implemented'
    local_setup('cellpadding.html', {:prefer_cellpadding => true})
    assert_equal '0', @doc.at('#t1')['cellpadding']
    assert_match /padding\:/i, @doc.at('#t1 td')['style']

    assert_equal '5', @doc.at('#t2')['cellpadding']
    refute_match /padding\:/i, @doc.at('#t2 td')['style']

    assert_nil @doc.at('#t3')['cellpadding']
    assert_match /padding\:/i, @doc.at('#t3 td')['style']

    assert_nil @doc.at('#t4')['cellpadding']
    assert_match /padding\:/i, @doc.at('#t4a')['style']
    assert_match /padding\:/i, @doc.at('#t4b')['style']
  end

  def test_preserving_media_queries
    flunk 'Not implemented'
    local_setup
    assert_match /display\: none/i, @doc.at('#iphone')['style']
  end
end