Sha256: accd8c250ffd386baef625f190f543abe6f8fd9adc85de13249d9a55dc6d836e

Contents?: true

Size: 758 Bytes

Versions: 6

Compression:

Stored size: 758 Bytes

Contents

require 'spec_helper'

describe ActiveAdmin::Views::Panel do
  include Arbre::HTML
  let(:assigns){ {} }

  let(:helpers) { action_view }

  let(:the_panel) do
    panel "My Title" do
      span("Hello World")
    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
    panel("Title", :icon => :arrow_down).find_by_tag("h3").first.content.should include("span class=\"icon")
  end

end

Version data entries

6 entries across 6 versions & 3 rubygems

Version Path
nsm-activeadmin-0.2.2 spec/unit/views/components/panel_spec.rb
saulolso-activeadmin-0.2.2.1 spec/unit/components/panel_spec.rb
saulolso-activeadmin-0.2.2 spec/unit/components/panel_spec.rb
activeadmin-0.2.2 spec/unit/components/panel_spec.rb
activeadmin-0.2.1 spec/unit/components/panel_spec.rb
activeadmin-0.2.0 spec/unit/components/panel_spec.rb