Sha256: 3500819b5828444f05d4a0e9d11ca8f246a4da3dccdd2244230ce1f836f3eabb

Contents?: true

Size: 842 Bytes

Versions: 6

Compression:

Stored size: 842 Bytes

Contents

require 'assert'
require 'deas-erbtags/tag'
require 'deas-erbtags/image_tag'

module Deas::ErbTags::ImageTag

  class BaseTests < Assert::Context
    desc "the `ImageTag` module"
    setup do
      @template = Factory.template(Deas::ErbTags::ImageTag)
    end
    subject{ @template }

    should have_imeth :image_tag

    should "include the `Tag` module" do
      assert_includes Deas::ErbTags::Tag, subject.class.included_modules
    end

    should "create an img tag with the given src" do
      img = subject.tag(:img, {:src => '/logo.jpg'})
      assert_equal img, subject.image_tag('/logo.jpg')
    end

    should "create an img tag with attrs" do
      img = subject.tag(:img, {
        :src => '/logo.jpg',
        :id => 'image'
      })
      assert_equal img, subject.image_tag('/logo.jpg', :id => 'image')
    end

  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
deas-erbtags-0.5.0 test/unit/image_tag_tests.rb
deas-erbtags-0.4.2 test/unit/image_tag_tests.rb
deas-erbtags-0.4.1 test/unit/image_tag_tests.rb
deas-erbtags-0.4.0 test/unit/image_tag_tests.rb
deas-erbtags-0.3.0 test/unit/image_tag_tests.rb
deas-erbtags-0.2.0 test/unit/image_tag_tests.rb