test/view_test.rb in shingara-will_paginate-2.3.3 vs test/view_test.rb in shingara-will_paginate-2.3.10

- old
+ new

@@ -190,17 +190,19 @@ paginate array.paginate(:page => 7, :per_page => 4) assert_equal %{Displaying strings <b>25&nbsp;-&nbsp;26</b> of <b>26</b> in total}, @html_result end - 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')) + 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')) - paginate collection - assert @html_result.index('project types'), "expected <#{@html_result.inspect}> to mention 'project types'" + 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 %>' @@ -272,9 +274,17 @@ paginate({ :page => 2 }, :param_name => :developers_page) do assert_select 'a[href]', 4 do |elements| validate_page_numbers [1,1,3,3], elements, :developers_page end end + end + + 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] end def test_complex_custom_page_param @request.params :developers => { :page => 2 }