Sha256: 0814dbaaa177be78b5d34b4753496e290ea8186cd918f209eef8f458c2660c69

Contents?: true

Size: 1.02 KB

Versions: 10

Compression:

Stored size: 1.02 KB

Contents

require 'rails_helper'

module BootstrapLeather
  RSpec.describe TabsHelper, folder: :helpers do
    describe '#add_tab and #render_tabs' do
      before do
        helper.add_tab 'Foo', 'foo' do
          Faker::Lorem.paragraph
        end
        helper.add_tab 'Bar', 'bar' do
          Faker::Lorem.paragraph
        end
      end
      subject { helper.render_tabs }
      it 'shows the tab links' do
        expect(subject).to(
          have_tag('div', with: { class: 'tabs-top' }) do
            with_tag 'ul', with: { class: 'nav-tabs' } do
              with_tag 'li' do
                with_tag 'a', text: /Foo/
              end
              with_tag 'li' do
                with_tag 'a', text: /Bar/
              end
            end
          end
        )
      end
      it 'shows the tabs' do
        expect(subject).to(
          have_tag('div', with: { class: 'tab-content' }) do
            with_tag 'div', with: { id: 'foo' }
            with_tag 'div', with: { id: 'bar' }
          end
        )
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
bootstrap_leather-0.10.14 spec/helpers/bootstrap_leather/tabs_helper_spec.rb
bootstrap_leather-0.10.13 spec/helpers/bootstrap_leather/tabs_helper_spec.rb
bootstrap_leather-0.10.11 spec/helpers/bootstrap_leather/tabs_helper_spec.rb
bootstrap_leather-0.10.10 spec/helpers/bootstrap_leather/tabs_helper_spec.rb
bootstrap_leather-0.10.9 spec/helpers/bootstrap_leather/tabs_helper_spec.rb
bootstrap_leather-0.10.8 spec/helpers/bootstrap_leather/tabs_helper_spec.rb
bootstrap_leather-0.10.7 spec/helpers/bootstrap_leather/tabs_helper_spec.rb
bootstrap_leather-0.10.6 spec/helpers/bootstrap_leather/tabs_helper_spec.rb
bootstrap_leather-0.10.5 spec/helpers/bootstrap_leather/tabs_helper_spec.rb
bootstrap_leather-0.10.4 spec/helpers/bootstrap_leather/tabs_helper_spec.rb