Sha256: 3afc90fee9085111d0aff05c544bb282ce84013b01444bc55ce142fbe2b1f36d

Contents?: true

Size: 824 Bytes

Versions: 15

Compression:

Stored size: 824 Bytes

Contents

require 'spec_helper'

describe ActiveAdmin::Views::SidebarSection do

  setup_arbre_context!

  let(:section) do
    ActiveAdmin::SidebarSection.new(:help) do
      span "Help Me"
    end
  end

  let(:html) do
    sidebar_section(section)
  end

  it "should have a title h3" do
    html.find_by_tag("h3").first.content.should == "Help"
  end

  it "should have the class of 'sidebar_section'" do
    html.class_list.should include("sidebar_section")
  end

  it "should have an id based on the title" do
    html.id.should == "help_sidebar_section"
  end

  it "should have a contents div" do
    html.find_by_tag("div").first.class_list.should include("panel_contents")
  end

  it "should add children to the contents div" do
    html.find_by_tag("span").first.parent.should == html.find_by_tag("div").first
  end

end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
activeadmin-0.4.4 spec/unit/views/components/sidebar_section_spec.rb
activeadmin-0.4.3 spec/unit/views/components/sidebar_section_spec.rb
activeadmin-0.4.2 spec/unit/views/components/sidebar_section_spec.rb
activeadmin-0.4.1 spec/unit/views/components/sidebar_section_spec.rb
activeadmin-0.4.0 spec/unit/views/components/sidebar_section_spec.rb
andrewroth_activeadmin-0.3.4.4 spec/unit/views/components/sidebar_section_spec.rb
andrewroth_activeadmin-0.3.4.3 spec/unit/views/components/sidebar_section_spec.rb
andrewroth_activeadmin-0.3.4.2 spec/unit/views/components/sidebar_section_spec.rb
andrewroth_activeadmin-0.3.4.1 spec/unit/views/components/sidebar_section_spec.rb
andrewroth_activeadmin-0.3.4 spec/unit/views/components/sidebar_section_spec.rb
activeadmin-0.3.4 spec/unit/views/components/sidebar_section_spec.rb
activeadmin-0.3.3 spec/unit/views/components/sidebar_section_spec.rb
activeadmin-0.3.2 spec/unit/views/components/sidebar_section_spec.rb
activeadmin-0.3.1 spec/unit/views/components/sidebar_section_spec.rb
activeadmin-0.3.0 spec/unit/views/components/sidebar_section_spec.rb