Sha256: ba64de03df5dabbe5d8e5ac496499826e8dd980a8f8e4fd60f8ac52e9dcc5c4f

Contents?: true

Size: 1022 Bytes

Versions: 11

Compression:

Stored size: 1022 Bytes

Contents

require "spec_helper"

module Refinery
  describe PaginationHelper do

    describe "#pagination_css_class" do
      context "when request.xhr? and params[:from_page] is set" do
        before do
          controller.request.stub(:xhr?).and_return(true)
        end

        context "when params[:from_page] > params[:page] or 1" do
          it "does something" do
            helper.stub(:params).and_return({:from_page => 2, :page => 1})
            helper.pagination_css_class.should == "frame_left"
          end
        end

        context "when params[:from_page] < params[:page] or 1" do
          it "returns frame_right" do
            helper.stub(:params).and_return({:from_page => 1, :page => 1})
            helper.pagination_css_class.should == "frame_right"
          end
        end
      end

      context "when request.xhr? and params[:from_page] isn't set" do
        it "returns frame_center" do
          helper.pagination_css_class.should == "frame_center"
        end
      end
    end

  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
refinerycms-core-2.1.5 spec/helpers/refinery/pagination_helper_spec.rb
refinerycms-core-2.1.4 spec/helpers/refinery/pagination_helper_spec.rb
refinerycms-core-2.1.3 spec/helpers/refinery/pagination_helper_spec.rb
refinerycms-core-2.1.2 spec/helpers/refinery/pagination_helper_spec.rb
refinerycms-core-2.1.1 spec/helpers/refinery/pagination_helper_spec.rb
refinerycms-core-2.1.0 spec/helpers/refinery/pagination_helper_spec.rb
refinerycms-core-2.0.10 spec/helpers/refinery/pagination_helper_spec.rb
refinerycms-core-2.0.9 spec/helpers/refinery/pagination_helper_spec.rb
refinerycms-core-2.0.8 spec/helpers/refinery/pagination_helper_spec.rb
refinerycms-core-2.0.7 spec/helpers/refinery/pagination_helper_spec.rb
refinerycms-core-2.0.6 spec/helpers/refinery/pagination_helper_spec.rb