Sha256: 6c920ff9bb025a464f3938ef2c048d0f61f47bcdc0254d47350eeca4f93add64

Contents?: true

Size: 915 Bytes

Versions: 1

Compression:

Stored size: 915 Bytes

Contents

require 'test_helper'

module BottleRocket
  module ContentTags
    class ContentTagTest < TestCase

      before do
        @tag = ContentTag.new(:div)
      end

      it 'should convert tag to string with block given' do
        string = 'test'
        tag = @tag.to_s { string }

        assert tag.is_a?(String)
        assert tag.include?('<div')
        assert tag.include?('</div>')
        assert tag.include?(string)
      end

      it 'should convert tag to string without block' do
        tag = @tag.to_s

        assert tag.is_a?(String)
        assert tag.include?('<div')
        assert tag.include?('</div>')
      end

      it 'converts attributes to html attributes' do
        tag = ContentTag.new(:div, {:class => 'some-class', :'data-test' => '5'})

        assert_equal 'class="some-class" data-test="5"', tag.html_attributes
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bottle_rocket-0.0.1 test/bottle_rocket/content_tag_test.rb