Sha256: d9eaaf8c75026c1c89f8319798d195774e7c2854fffe301e23beec9d6e248c00

Contents?: true

Size: 946 Bytes

Versions: 4

Compression:

Stored size: 946 Bytes

Contents

require 'spec_helper'

module Ecm
  describe SlidersHelper do
    describe "#render_slider" do
      context "basic behaviour" do
        before(:each) do
          @slider = FactoryGirl.create(:ecm_sliders_slider_with_items)
        end

        subject { helper.render_slider(@slider.name) }

        it "should include the body of all items" do
          @slider.ecm_sliders_items.each do |item|
            subject.should have_content(item.body)
          end
        end
      end

      context "uses slider without locale if there is no better" do
        before(:each) do
          @slider = FactoryGirl.create(:ecm_sliders_slider_with_items, :locale => nil)
        end

        subject { helper.render_slider(@slider.name) }

        it "should include the body of all items" do
          @slider.ecm_sliders_items.each do |item|
            subject.should have_content(item.body)
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ecm_sliders2-0.0.4 spec/helpers/ecm/sliders_helper_spec.rb
ecm_sliders2-0.0.3 spec/helpers/ecm/sliders_helper_spec.rb
ecm_sliders2-0.0.2 spec/helpers/ecm/sliders_helper_spec.rb
ecm_sliders2-0.0.1 spec/helpers/ecm/sliders_helper_spec.rb