Sha256: d6b4ec01bb388e48e9073b5f9460bedccf036118f45930c2dfa8526a683edb4e
Contents?: true
Size: 1.46 KB
Versions: 3
Compression:
Stored size: 1.46 KB
Contents
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe RailsPaginate::Helpers::ActionView do context "ActionView::Base.new" do let(:collection) { (1..55).to_a.paginate } subject { action_view } specify { should respond_to :paginate } it "#paginate should raise an error when no collection given" do lambda { subject.paginate }.should raise_error(ArgumentError) end [ {:items => 100, :page => 1, :per_page => 15}, {:items => 300, :page => 2, :per_page => 50}, {:items => 11, :page => 5, :per_page => 15}, {:items => 0, :page => 1, :per_page => 15}, {:items => 12, :page => 1, :per_page => 15} ].each do |config| context "#paginate an Array with #{config[:items]} items, page #{config[:page]}, per_page #{config[:per_page]}" do before do @collection = (1..config[:items]).to_a.paginate :page => config[:page], :per_page => config[:per_page] @pagination = action_view.paginate @collection end subject { @pagination } it("return should be a kind of String") { should be_a String } end end context "#paginate with class => dummy" do subject { action_view.paginate collection, :class => "dummy" } it("should have one div.pagination.dummy") { subject.should have_tag('div.pagination.dummy', :count => 1) } it("should have one div with ul") { subject.should have_tag('div > ul', :count => 1) } end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
rails_paginate-0.0.7 | spec/helpers/action_view_spec.rb |
rails_paginate-0.0.6 | spec/helpers/action_view_spec.rb |
rails_paginate-0.0.5 | spec/helpers/action_view_spec.rb |