Sha256: 0447448cd76a59175e6fd73d5a1a7ceac9687efb583090e5ad8751e533424367

Contents?: true

Size: 980 Bytes

Versions: 2

Compression:

Stored size: 980 Bytes

Contents

require 'spec_helper'

describe NeatPages::Helpers do
  describe "#status" do
    context "with a 100 items pagination starting at 0 and having 10 items per page" do
      let(:neat_pages) { NeatPages::Base.new(0, :per_page => 10, :total_items => 100) }

      before { neat_pages.activate_helpers }

      specify { neat_pages.helpers.status.should eql "1 to 10/100" }
    end

    context "with a 23 items pagination starting at page 3 and having 10 items per page" do
      let(:neat_pages) { NeatPages::Base.new(3, :per_page => 10, :total_items => 23) }

      before { neat_pages.activate_helpers }

      specify { neat_pages.helpers.status.should eql "21 to 23/23" }
    end

    context "with a 0 items pagination starting at 0 and having 10 items per page" do
      let(:neat_pages) { NeatPages::Base.new(0, :per_page => 10, :total_items => 0) }

      before { neat_pages.activate_helpers }

      specify { neat_pages.helpers.status.should be_empty }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
neat-pages-0.0.2 spec/neat_pages/helpers_spec.rb
neat-pages-0.0.1 spec/neat_pages/helpers_spec.rb