Class: PaginationHelperTest
- Inherits:
-
Test::Unit::TestCase
- Object
- Test::Unit::TestCase
- PaginationHelperTest
- Includes:
- ActionController::Pagination, ActionView::Helpers::PaginationHelper, ActionView::Helpers::TagHelper, ActionView::Helpers::UrlHelper
- Defined in:
- vendor/plugins/classic_pagination/test/pagination_helper_test.rb
Constant Summary
Constants included from ActionController::Pagination
Constants included from ActionView::Helpers::PaginationHelper
Instance Method Summary
- - (Object) setup
- - (Object) test_pagination_links
- - (Object) test_pagination_links_with_prefix
- - (Object) test_pagination_links_with_suffix
Methods included from ActionController::Pagination
included, #paginate, validate_options!
Methods included from ActionView::Helpers::PaginationHelper
#pagination_links, #pagination_links_each
Instance Method Details
- (Object) setup
10 11 12 13 14 15 16 17 18 19 |
# File 'vendor/plugins/classic_pagination/test/pagination_helper_test.rb', line 10 def setup @controller = Class.new do attr_accessor :url, :request def url_for(, *parameters_for_method_reference) url end end @controller = @controller.new @controller.url = "http://www.example.com" end |
- (Object) test_pagination_links
21 22 23 24 25 |
# File 'vendor/plugins/classic_pagination/test/pagination_helper_test.rb', line 21 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 |
- (Object) test_pagination_links_with_prefix
27 28 29 30 31 |
# File 'vendor/plugins/classic_pagination/test/pagination_helper_test.rb', line 27 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 |
- (Object) test_pagination_links_with_suffix
33 34 35 36 37 |
# File 'vendor/plugins/classic_pagination/test/pagination_helper_test.rb', line 33 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 |