spec/unit/views/components/sidebar_section_spec.rb in activeadmin-1.0.0.pre1 vs spec/unit/views/components/sidebar_section_spec.rb in activeadmin-1.0.0.pre2

- old
+ new

@@ -42,6 +42,27 @@ it "should have 'custom_class' class" do expect(html.class_list).to include("custom_class") end end + context "with attributes_table for resource" do + let(:post) { Post.create!(title: "Testing.") } + let(:section) do + ActiveAdmin::SidebarSection.new("Summary", options) do + attributes_table do + row :title + end + end + end + let(:assigns) { { resource: post, section: section } } + let(:html) do + render_arbre_component assigns do + sidebar_section(assigns[:section]) + end + end + + it "should have table" do + expect(html.find_by_tag("th").first.content).to eq "Title" + expect(html.find_by_tag("td").first.content).to eq "Testing." + end + end end