Sha256: 02e27b908c9326d7539886d9e444582741c24bfc5b303b7bb17c5a34445176f5

Contents?: true

Size: 804 Bytes

Versions: 5

Compression:

Stored size: 804 Bytes

Contents

require 'spec_helper'

describe ActiveAdmin::Views::IndexList do

  describe "#index_list_renderer" do


    let(:index_classes) { [ActiveAdmin::Views::IndexAsTable, ActiveAdmin::Views::IndexAsBlock] }

    let(:helpers) do
      helpers = mock_action_view
      helpers.stub url_for: "/"
      helpers.stub(:params).and_return as: "table"
      helpers
    end

    subject do
      render_arbre_component({:index_classes => index_classes}, helpers) do
        index_list_renderer(index_classes)
      end
    end

    its(:tag_name) { should == 'ul' }

    it "should contain the names of available indexes in links" do
      a_tags = subject.find_by_tag("a")
      a_tags.size.should == 2
      a_tags.first.to_s.should include("Table")
      a_tags.last.to_s.should include("List")
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
yousty-activeadmin-1.0.4.pre spec/unit/views/components/index_list_spec.rb
yousty-activeadmin-1.0.3.pre spec/unit/views/components/index_list_spec.rb
yousty-activeadmin-1.0.2.pre spec/unit/views/components/index_list_spec.rb
yousty-activeadmin-1.0.1.pre spec/unit/views/components/index_list_spec.rb
yousty-activeadmin-1.0.0.pre spec/unit/views/components/index_list_spec.rb