Sha256: 8dd012e7cd31d4f88a13a14d3437a4e9632dae2f18a22bbe4b6ce9c32f159ca5

Contents?: true

Size: 921 Bytes

Versions: 25

Compression:

Stored size: 921 Bytes

Contents

require 'rails_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
      allow(helpers).to receive(:url_for).and_return("/")
      allow(helpers).to receive(: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

    describe '#tag_name' do
      subject { super().tag_name }
      it { is_expected.to eq 'ul'}
    end

    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

25 entries across 25 versions & 4 rubygems

Version Path
activeadmin_addons-1.1.2 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-a5a53c3f2b8f/spec/unit/views/components/index_list_spec.rb
activeadmin_addons-1.1.1 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-a5a53c3f2b8f/spec/unit/views/components/index_list_spec.rb
yousty-activeadmin-1.0.17.pre spec/unit/views/components/index_list_spec.rb
yousty-activeadmin-1.0.16.pre spec/unit/views/components/index_list_spec.rb
activeadmin_addons-1.1.0 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-a5a53c3f2b8f/spec/unit/views/components/index_list_spec.rb
activeadmin_addons-1.0.1 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-a5a53c3f2b8f/spec/unit/views/components/index_list_spec.rb
activeadmin_addons-1.0.0 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-a5a53c3f2b8f/spec/unit/views/components/index_list_spec.rb
yousty-activeadmin-1.0.15.pre spec/unit/views/components/index_list_spec.rb
activeadmin-orac-1.0.0.pre4 spec/unit/views/components/index_list_spec.rb
activeadmin-orac-1.0.0 spec/unit/views/components/index_list_spec.rb
activeadmin-orac-1.0.0.pre.orac spec/unit/views/components/index_list_spec.rb
yousty-activeadmin-1.0.14.pre spec/unit/views/components/index_list_spec.rb
yousty-activeadmin-1.0.13.pre spec/unit/views/components/index_list_spec.rb
yousty-activeadmin-1.0.12.pre spec/unit/views/components/index_list_spec.rb
yousty-activeadmin-1.0.11.pre spec/unit/views/components/index_list_spec.rb
yousty-activeadmin-1.0.10.pre spec/unit/views/components/index_list_spec.rb
yousty-activeadmin-1.0.9.pre spec/unit/views/components/index_list_spec.rb
yousty-activeadmin-1.0.8.pre spec/unit/views/components/index_list_spec.rb
activeadmin-1.0.0.pre4 spec/unit/views/components/index_list_spec.rb
activeadmin-1.0.0.pre3 spec/unit/views/components/index_list_spec.rb