mirror of
https://github.com/kaminari/kaminari.git
synced 2022-11-09 13:44:37 -05:00
fix issue#276
This commit is contained in:
parent
dfd380d0bb
commit
cd0ee29e02
2 changed files with 9 additions and 1 deletions
|
@ -88,7 +88,7 @@ module Kaminari
|
|||
def page_entries_info(collection, options = {})
|
||||
entry_name = if options[:entry_name]
|
||||
options[:entry_name]
|
||||
elsif collection.empty?
|
||||
elsif collection.empty? || collection.is_a?(PaginatableArray)
|
||||
'entry'
|
||||
else
|
||||
if collection.respond_to? :model # DataMapper
|
||||
|
|
|
@ -214,6 +214,14 @@ describe 'Kaminari::ActionViewExtension' do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'on a PaginatableArray' do
|
||||
before do
|
||||
@numbers = Kaminari.paginate_array(%w{one two three}).page(1)
|
||||
end
|
||||
subject { helper.page_entries_info @numbers }
|
||||
it { should == 'Displaying <b>all 3</b> entries' }
|
||||
end
|
||||
end
|
||||
|
||||
describe '#rel_next_prev_link_tags' do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue