Sha256: 523b1c2110e429242f1ac62d67880a6903a512dbe9151af948d3e656e885cab6

Contents?: true

Size: 1 KB

Versions: 50

Compression:

Stored size: 1 KB

Contents

require 'spec_helper'

describe ActiveAdmin::Views::Panel do

  let(:the_panel) do
    render_arbre_component do
      panel "My Title" do
        span("Hello World")
      end
    end
  end

  it "should have a title h3" do
    the_panel.find_by_tag("h3").first.content.should == "My Title"
  end

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

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

  it "should set the icon" do
    the_panel = render_arbre_component do
      panel("Title", :icon => :arrow_down)
    end
    the_panel.find_by_tag("h3").first.content.should include("span class=\"icon")
  end

  describe "#children?" do

    it "returns false if no children have been added to the panel" do
      the_panel = render_arbre_component do
        panel("A Panel")
      end
      the_panel.children?.should == false
    end

  end

end

Version data entries

50 entries across 50 versions & 2 rubygems

Version Path
lalala-4.0.0.dev.141 vendor/deps/active_admin/spec/unit/views/components/panel_spec.rb
lalala-4.0.0.dev.136 vendor/deps/active_admin/spec/unit/views/components/panel_spec.rb
lalala-4.0.0.dev.135 vendor/deps/active_admin/spec/unit/views/components/panel_spec.rb
lalala-4.0.0.dev.134 vendor/deps/active_admin/spec/unit/views/components/panel_spec.rb
lalala-4.0.0.dev.133 vendor/deps/active_admin/spec/unit/views/components/panel_spec.rb
lalala-4.0.0.dev.132 vendor/deps/active_admin/spec/unit/views/components/panel_spec.rb
lalala-4.0.0.dev.131 vendor/deps/active_admin/spec/unit/views/components/panel_spec.rb
lalala-4.0.0.dev.129 vendor/deps/active_admin/spec/unit/views/components/panel_spec.rb
lalala-4.0.0.dev.128 vendor/deps/active_admin/spec/unit/views/components/panel_spec.rb
lalala-4.0.0.dev.126 vendor/deps/active_admin/spec/unit/views/components/panel_spec.rb
lalala-4.0.0.dev.125 vendor/deps/active_admin/spec/unit/views/components/panel_spec.rb
lalala-4.0.0.dev.124 vendor/deps/active_admin/spec/unit/views/components/panel_spec.rb
lalala-4.0.0.dev.123 vendor/deps/active_admin/spec/unit/views/components/panel_spec.rb
lalala-4.0.0.dev.118 vendor/deps/active_admin/spec/unit/views/components/panel_spec.rb
lalala-4.0.0.dev.116 vendor/deps/active_admin/spec/unit/views/components/panel_spec.rb
lalala-4.0.0.dev.114 vendor/deps/active_admin/spec/unit/views/components/panel_spec.rb
lalala-4.0.0.dev.113 vendor/deps/active_admin/spec/unit/views/components/panel_spec.rb
lalala-4.0.0.dev.111 vendor/deps/active_admin/spec/unit/views/components/panel_spec.rb
lalala-4.0.0.dev.109 vendor/deps/active_admin/spec/unit/views/components/panel_spec.rb
lalala-4.0.0.dev.107 vendor/deps/active_admin/spec/unit/views/components/panel_spec.rb