Sha256: 6095f796a05b487d9fcab1692480efb4a9f898d3b9b690a888027f7355b71f90

Contents?: true

Size: 1.25 KB

Versions: 26

Compression:

Stored size: 1.25 KB

Contents

require File.dirname(__FILE__) + '/spec_helper'

# Merb::Router.prepare do
#   default_routes
# end

describe Merb::Helpers::Tag do
  include Merb::Helpers::Tag
  
  describe "#tag" do
    it 'generates <div>content</div> from tag :div, "content"' do
      response = request "/tag_helper/tag_with_content"

      response.should have_selector("div")
      response.body.to_s.should include("Astral Projection ~ Dancing Galaxy")
    end

    it 'outputs content returned by the block when block is given'  do
      response = request "/tag_helper/tag_with_content_in_the_block"

      response.should have_selector("div")
      response.body.should include("Astral Projection ~ Trust in Trance 1")
    end

    it 'generates tag attributes for all of keys of last Hash' do
      response = request "/tag_helper/tag_with_attributes"

      response.should have_selector("div.psy")
      response.should have_selector("div#bands")
      response.should have_selector("div[invalid_attr='at least in html']")
    end    

    it 'handles nesting of tags/blocks' do
      response = request "/tag_helper/nested_tags"

      response.should have_selector("div.discography ul.albums li.first")
      response.should have_selector("#tit:contains('Trust in Trance 2')")
    end
  end
end

Version data entries

26 entries across 26 versions & 2 rubygems

Version Path
merb-core-1.1.3 spec10/public/webrat/test_app/gems/gems/merb-helpers-0.9.14/spec/merb_helpers_tag_helper_spec.rb
merb-core-1.1.2 spec10/public/webrat/test_app/gems/gems/merb-helpers-0.9.14/spec/merb_helpers_tag_helper_spec.rb
merb-core-1.1.1 spec10/public/webrat/test_app/gems/gems/merb-helpers-0.9.14/spec/merb_helpers_tag_helper_spec.rb
merb-core-1.1.0 spec10/public/webrat/test_app/gems/gems/merb-helpers-0.9.14/spec/merb_helpers_tag_helper_spec.rb
merb-core-1.1.0.rc1 spec10/public/webrat/test_app/gems/gems/merb-helpers-0.9.14/spec/merb_helpers_tag_helper_spec.rb
merb-core-1.1.0.pre spec10/public/webrat/test_app/gems/gems/merb-helpers-0.9.14/spec/merb_helpers_tag_helper_spec.rb
merb-helpers-1.0.15 spec/merb_helpers_tag_helper_spec.rb
merb-helpers-1.0.14 spec/merb_helpers_tag_helper_spec.rb
merb-helpers-1.0.13 spec/merb_helpers_tag_helper_spec.rb
merb-helpers-1.0.12 spec/merb_helpers_tag_helper_spec.rb
merb-helpers-1.0.6.1 spec/merb_helpers_tag_helper_spec.rb
merb-helpers-0.9.13 spec/merb_helpers_tag_helper_spec.rb
merb-helpers-1.0.1 spec/merb_helpers_tag_helper_spec.rb
merb-helpers-1.0.10 spec/merb_helpers_tag_helper_spec.rb
merb-helpers-1.0.11 spec/merb_helpers_tag_helper_spec.rb
merb-helpers-1.0.4 spec/merb_helpers_tag_helper_spec.rb
merb-helpers-1.0.2 spec/merb_helpers_tag_helper_spec.rb
merb-helpers-1.0.3 spec/merb_helpers_tag_helper_spec.rb
merb-helpers-1.0.5 spec/merb_helpers_tag_helper_spec.rb
merb-helpers-1.0.7.1 spec/merb_helpers_tag_helper_spec.rb