public
Rubygem
Description: Most awesome pagination solution for Rails
Homepage: http://github.com/mislav/will_paginate/wikis
Clone URL: git://github.com/mislav/will_paginate.git
Search Repo:
fix spec for will_paginate in ViewHelpers::Common
mislav (author)
Fri May 09 03:06:08 -0700 2008
commit  c71ca99e4884da1da782811dcb8f43382326fd6d
tree    570340726402c8988142679506aaf94b83850b32
parent  ad66001d7f816ddfcdaf24e75c0fd1fd1dfc464a
...
1
2
3
 
 
4
5
6
...
1
2
3
4
5
6
7
8
0
@@ -1,6 +1,8 @@
0
 require 'set'
0
 require 'will_paginate/array'
0
 
0
+## Everything below blatantly stolen from ActiveSupport :o
0
+
0
 unless Hash.instance_methods.include? 'except'
0
   Hash.class_eval do
0
     # Returns a new hash without the given keys.
...
57
58
59
60
 
61
62
63
...
57
58
59
 
60
61
62
63
0
@@ -57,7 +57,7 @@
0
         # get the renderer instance
0
         renderer = case options[:renderer]
0
         when String
0
- options[:renderer].to_s.constantize.new
0
+ options[:renderer]..constantize.new
0
         when Class
0
           options[:renderer].new
0
         else
...
9
10
11
12
 
 
 
 
 
13
14
15
...
9
10
11
 
12
13
14
15
16
17
18
19
0
@@ -9,7 +9,11 @@
0
   describe "will_paginate" do
0
     it "should render" do
0
       collection = WillPaginate::Collection.new(1, 2, 4)
0
- will_paginate(collection).should_not be_nil
0
+ renderer = mock 'Renderer'
0
+ renderer.expects(:prepare).with(collection, instance_of(Hash), self)
0
+ renderer.expects(:to_html).returns('<PAGES>')
0
+
0
+ will_paginate(collection, :renderer => renderer).should == '<PAGES>'
0
     end
0
     
0
     it "should return nil for single-page collections" do

Comments

    No one has commented yet.