test/view_test.rb in will_paginate-2.3.15 vs test/view_test.rb in will_paginate-2.3.16
- old
+ new
@@ -194,40 +194,40 @@
uses_mocha 'class name' do
def test_page_entries_info_with_longer_class_name
@template = '<%= page_entries_info collection %>'
collection = ('a'..'z').to_a.paginate
- collection.first.stubs(:class).returns(mock('class', :name => 'ProjectType'))
+ collection.first.stubs(:class).returns(mock('class', :to_s => 'ProjectType'))
paginate collection
assert @html_result.index('project types'), "expected <#{@html_result.inspect}> to mention 'project types'"
end
end
def test_page_entries_info_with_single_page_collection
@template = '<%= page_entries_info collection %>'
paginate(('a'..'d').to_a.paginate(:page => 1, :per_page => 5))
- assert_equal %{Displaying <b>all 4</b> strings}, @html_result
+ assert_equal %{Displaying <b>all 4</b> strings}, @html_result
paginate(['a'].paginate(:page => 1, :per_page => 5))
assert_equal %{Displaying <b>1</b> string}, @html_result
paginate([].paginate(:page => 1, :per_page => 5))
assert_equal %{No entries found}, @html_result
end
def test_page_entries_info_with_custom_entry_name
- @template = '<%= page_entries_info collection, :entry_name => "author" %>'
+ @template = '<%= page_entries_info collection, :model => "author" %>'
entries = (1..20).to_a
paginate(entries.paginate(:page => 1, :per_page => 5))
assert_equal %{Displaying authors <b>1 - 5</b> of <b>20</b> in total}, @html_result
paginate(entries.paginate(:page => 1, :per_page => 20))
- assert_equal %{Displaying <b>all 20</b> authors}, @html_result
+ assert_equal %{Displaying <b>all 20</b> authors}, @html_result
paginate(['a'].paginate(:page => 1, :per_page => 5))
assert_equal %{Displaying <b>1</b> author}, @html_result
paginate([].paginate(:page => 1, :per_page => 5))
@@ -281,10 +281,10 @@
def test_will_paginate_with_atmark_url
@request.symbolized_path_parameters[:action] = "@tag"
renderer = WillPaginate::LinkRenderer.new
paginate({ :page => 1 }, :renderer=>renderer)
- assert_links_match %r[/foo/@tag\?page=\d]
+ assert_links_match %r[/foo/(?:@|%40)tag\?page=\d]
end
def test_complex_custom_page_param
@request.params :developers => { :page => 2 }