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.94 vendor/deps/active_admin/spec/unit/views/components/panel_spec.rb
lalala-4.0.0.dev.92 vendor/deps/active_admin/spec/unit/views/components/panel_spec.rb
lalala-4.0.0.dev.90 vendor/deps/active_admin/spec/unit/views/components/panel_spec.rb
lalala-4.0.0.dev.84 vendor/deps/active_admin/spec/unit/views/components/panel_spec.rb
lalala-4.0.0.dev.80 vendor/deps/active_admin/spec/unit/views/components/panel_spec.rb
lalala-4.0.0.dev.79 vendor/deps/active_admin/spec/unit/views/components/panel_spec.rb
lalala-4.0.0.dev.78 vendor/deps/active_admin/spec/unit/views/components/panel_spec.rb
lalala-4.0.0.dev.77 vendor/deps/active_admin/spec/unit/views/components/panel_spec.rb
lalala-4.0.0.dev.74 vendor/deps/active_admin/spec/unit/views/components/panel_spec.rb
lalala-4.0.0.dev.73 vendor/deps/active_admin/spec/unit/views/components/panel_spec.rb
lalala-4.0.0.dev.72 vendor/deps/active_admin/spec/unit/views/components/panel_spec.rb
lalala-4.0.0.dev.71 vendor/deps/active_admin/spec/unit/views/components/panel_spec.rb
lalala-4.0.0.dev.66 vendor/deps/active_admin/spec/unit/views/components/panel_spec.rb
lalala-4.0.0.dev.65 vendor/deps/active_admin/spec/unit/views/components/panel_spec.rb
activeadmin-0.6.0 spec/unit/views/components/panel_spec.rb
lalala-4.0.0.dev.64 vendor/deps/active_admin/spec/unit/views/components/panel_spec.rb
lalala-4.0.0.dev.63 vendor/deps/active_admin/spec/unit/views/components/panel_spec.rb
lalala-4.0.0.dev.62 vendor/deps/active_admin/spec/unit/views/components/panel_spec.rb
lalala-4.0.0.dev.61 vendor/deps/active_admin/spec/unit/views/components/panel_spec.rb
lalala-4.0.0.dev.60 vendor/deps/active_admin/spec/unit/views/components/panel_spec.rb