Permalink
Browse files

fix issue#276

  • Loading branch information...
1 parent dfd380d commit cd0ee29e027c70ff7e42e7fcbcb2847cb36cf96f @eitoball eitoball committed Sep 2, 2012
Showing with 9 additions and 1 deletion.
  1. +1 −1 lib/kaminari/helpers/action_view_extension.rb
  2. +8 −0 spec/helpers/action_view_extension_spec.rb
@@ -88,7 +88,7 @@ def link_to_next_page(scope, name, options = {}, &block)
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 @@
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

0 comments on commit cd0ee29

Please sign in to comment.