mirror of
https://github.com/redmine/redmine.git
synced 2025-11-12 16:26:03 +01:00
Merged Rails 2.0 compatibility changes.
Compatibility with Rails 1.2 is preserved. git-svn-id: http://redmine.rubyforge.org/svn/trunk@975 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
38
vendor/plugins/classic_pagination/test/pagination_helper_test.rb
vendored
Normal file
38
vendor/plugins/classic_pagination/test/pagination_helper_test.rb
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
require File.dirname(__FILE__) + '/helper'
|
||||
require File.dirname(__FILE__) + '/../init'
|
||||
|
||||
class PaginationHelperTest < Test::Unit::TestCase
|
||||
include ActionController::Pagination
|
||||
include ActionView::Helpers::PaginationHelper
|
||||
include ActionView::Helpers::UrlHelper
|
||||
include ActionView::Helpers::TagHelper
|
||||
|
||||
def setup
|
||||
@controller = Class.new do
|
||||
attr_accessor :url, :request
|
||||
def url_for(options, *parameters_for_method_reference)
|
||||
url
|
||||
end
|
||||
end
|
||||
@controller = @controller.new
|
||||
@controller.url = "http://www.example.com"
|
||||
end
|
||||
|
||||
def test_pagination_links
|
||||
total, per_page, page = 30, 10, 1
|
||||
output = pagination_links Paginator.new(@controller, total, per_page, page)
|
||||
assert_equal "1 <a href=\"http://www.example.com\">2</a> <a href=\"http://www.example.com\">3</a> ", output
|
||||
end
|
||||
|
||||
def test_pagination_links_with_prefix
|
||||
total, per_page, page = 30, 10, 1
|
||||
output = pagination_links Paginator.new(@controller, total, per_page, page), :prefix => 'Newer '
|
||||
assert_equal "Newer 1 <a href=\"http://www.example.com\">2</a> <a href=\"http://www.example.com\">3</a> ", output
|
||||
end
|
||||
|
||||
def test_pagination_links_with_suffix
|
||||
total, per_page, page = 30, 10, 1
|
||||
output = pagination_links Paginator.new(@controller, total, per_page, page), :suffix => 'Older'
|
||||
assert_equal "1 <a href=\"http://www.example.com\">2</a> <a href=\"http://www.example.com\">3</a> Older", output
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user