Sha256: 2371739bc97c1573116aa39af8beacd416f3a02e771598c73eac0e5e07bd1487

Contents?: true

Size: 576 Bytes

Versions: 10

Compression:

Stored size: 576 Bytes

Contents

require "test_helper"

class CustomTagTest < ActionView::TestCase
  include Metamagic::ViewHelper

  test "custom tags" do
    Metamagic::Renderer.register_tag_type :custom, ->(key, value) { tag(:custom_tag, one: key, two: value) }

    meta title: "Test Title",
         custom: {
           first: "This is the first",
           second: "This is the second"
         }

    assert_equal %{<title>Test Title</title>\n<custom_tag one="custom:first" two="This is the first" />\n<custom_tag one="custom:second" two="This is the second" />},
                 metamagic
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
metamagic-3.1.7 test/custom_tag_test.rb
metamagic-3.1.6 test/custom_tag_test.rb
metamagic-3.1.5 test/custom_tag_test.rb
metamagic-3.1.4 test/custom_tag_test.rb
metamagic-3.1.3 test/custom_tag_test.rb
metamagic-3.1.2 test/custom_tag_test.rb
metamagic-3.1.1 test/custom_tag_test.rb
metamagic-3.1.0 test/custom_tag_test.rb
metamagic-3.0.3 test/custom_tag_test.rb
metamagic-3.0.2 test/custom_tag_test.rb