Sha256: cf908d1dc8f6f6f8257cfeb8bf3f9f0fcbd56b17a181543098d7972063424907

Contents?: true

Size: 629 Bytes

Versions: 1

Compression:

Stored size: 629 Bytes

Contents

require "spec_helper"

describe Paginate::Config do
  it "yields configuration class" do
    Paginate.configure do |config|
      config.param_name = :p
      config.size  = 50
    end

    Paginate::Config.param_name.should == :p
    Paginate::Config.size.should == 50
  end

  it "deprecates Paginate.setup method" do
    Paginate.should_receive(:warn).once
    Paginate.setup {}
  end

  it "returns configuration as hash" do
    Paginate.configure do |config|
      config.param_name = :p
      config.size = 25
    end

    options = {:param_name => :p, :size => 25}
    Paginate::Config.to_hash.should == options
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
paginate-1.0.1 spec/paginate/config_spec.rb