Sha256: f1b25e5afa15d3bb54a983e2877347b137ca0d8dd82ba29eb69c5552d38c8744

Contents?: true

Size: 1.5 KB

Versions: 7

Compression:

Stored size: 1.5 KB

Contents

require 'test_helper'

class StructureHelperTest < EaselHelpers::ViewTestCase

  context "blockquote" do

    should "default with the correct structure" do
      show_view "<% blockquote do %>My quoted text<% end %>" do
        assert_select "blockquote", "My quoted text"
      end
    end

    should "default with the correct structure when an author is set" do
      show_view "<% blockquote :author => 'W. Shakespeare' do %>All the world's a stage<% end %>" do
        assert_select "div.quote-cited" do
          assert_select "blockquote", "All the world's a stage"
          assert_select "cite", "W. Shakespeare"
        end
      end
    end

  end

  context "body" do

    should "allow passing a block structure" do
      show_view %(
        <% body do %>body goes here<% end %>
      ) do
        assert_select "body", "body goes here"
      end
    end

    should "allow passing arguments" do
      show_view %(
        <% body :home, 'home-index', 'logged-in', :id => 'application' do %>body goes here<% end %>
      ) do
        assert_select "body#application.home.home-index.logged-in", "body goes here"
      end
    end

    should "allow multiple body definitions that set attributes" do
      show_view %(
        <% body :home, 'logged-in' %>
        <% body :id => 'application' %>
        <% body 'home-index', :id => 'application-override' do %>body goes here<% end %>
      ) do
        assert_select "body#application-override.home.home-index.logged-in", "body goes here"
      end
    end

  end

end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
fusionary-easel_helpers-0.2.12 test/structure_helper_test.rb
fusionary-easel_helpers-0.2.13 test/structure_helper_test.rb
fusionary-easel_helpers-0.2.14 test/structure_helper_test.rb
fusionary-easel_helpers-0.2.16 test/structure_helper_test.rb
fusionary-easel_helpers-0.2.17 test/structure_helper_test.rb
fusionary-easel_helpers-0.3.0 test/structure_helper_test.rb
easel_helpers-0.3.0 test/structure_helper_test.rb