Sha256: df9ce70876bd277851141362861c26f00e05fabf347c5f3fb94453592e83b19c

Contents?: true

Size: 996 Bytes

Versions: 2

Compression:

Stored size: 996 Bytes

Contents

require 'rails_helper'

RSpec.describe ActiveAdmin::Views::Tabs do
  describe "creating with the dsl" do
    context "when creating tabs with a symbol" do
      let(:tabs) do
        render_arbre_component do
          tabs do
            tab :overview
          end
        end
      end

      it "should create a tab navigation bar based on the symbol" do
        expect(tabs.find_by_tag('li').first.content).to include "Overview"
      end
    end

    context "when creating a tab with a block" do
      let(:tabs) do
        render_arbre_component do
          tabs do
            tab :overview do
              span 'tab 1'
            end
          end
        end
      end

      it "should create a tab navigation bar based on the symbol" do
        expect(tabs.find_by_tag('li').first.content).to include "Overview"
      end

      it "should create a tab with a span inside of it" do
        expect(tabs.find_by_tag('span').first.content).to eq('tab 1')
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
activeadmin-1.0.0 spec/unit/views/components/tabs_spec.rb
activeadmin-1.0.0.pre5 spec/unit/views/components/tabs_spec.rb