Sha256: 54299a524659e258cbd592831997b111ddcb6d79b73d2b81033fabe232546334

Contents?: true

Size: 1.09 KB

Versions: 10

Compression:

Stored size: 1.09 KB

Contents

require 'rails_helper'

module BootstrapLeather
  RSpec.describe CarouselsHelper, folder: :helpers do
    helper IconsHelper
    helper HeadHelper
    helper FootHelper

    describe '#carousel' do
      subject do
        helper.carousel 'css-id', DooDad.all do |item|
          %(
<div class='carousel-caption'><h4>#{item.name}</h4></div>
<p>#{item.body}</p>
).html_safe
        end
      end
      it do
        should have_tag 'div', with: {
          class: 'carousel', id: 'css-id'
        }
      end
      it { should have_tag 'div', with: { class: 'item' }, count: 5}
    end

    describe '#carousel_with_thumbnails' do
      subject do
        helper.carousel_with_thumbnails 'css-id', DooDad.all do |item|
          %(
<div class='carousel-caption'><h4>#{item.name}</h4></div>
<p>#{item.body}</p>
#{image_tag 'src.png', data: { thumbnail: 'thumb.png' }}
).html_safe
        end
      end
      it do
        should have_tag 'div', with: {
          class: 'carousel-with-thumbnails', id: 'css-id'
        }
      end
      it { should have_tag 'div', with: { class: 'item' }, count: 5}
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

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