Sha256: 2342d2d3040019a50040b12418101472c55957335bc4562898794083feff2a66

Contents?: true

Size: 812 Bytes

Versions: 5

Compression:

Stored size: 812 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 eq 'ul'}

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

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
active_administration-0.0.3 spec/unit/views/components/index_list_spec.rb
activeadministration-0.0.2 spec/unit/views/components/index_list_spec.rb
active_administration-0.0.2 spec/unit/views/components/index_list_spec.rb
activeadministration-0.0.1 spec/unit/views/components/index_list_spec.rb
active_administration-0.0.1 spec/unit/views/components/index_list_spec.rb