diff --git a/kaminari-core/test/fake_app/rails_app.rb b/kaminari-core/test/fake_app/rails_app.rb index 08f0a46..bedeca7 100644 --- a/kaminari-core/test/fake_app/rails_app.rb +++ b/kaminari-core/test/fake_app/rails_app.rb @@ -35,6 +35,8 @@ class UsersController < ApplicationController @users = User.page params[:page] render inline: <<-ERB <%= @users.map(&:name).join("\n") %> +<%= link_to_previous_page @users, 'previous page', class: 'prev' %> +<%= link_to_next_page @users, 'next page', class: 'next' %> <%= paginate @users %>
<%= page_entries_info @users %>
ERB diff --git a/kaminari-core/test/requests/navigation_test.rb b/kaminari-core/test/requests/navigation_test.rb index bc66509..222da28 100644 --- a/kaminari-core/test/requests/navigation_test.rb +++ b/kaminari-core/test/requests/navigation_test.rb @@ -18,6 +18,9 @@ class NavigationTest < Test::Unit::TestCase test 'navigating by pagination links' do visit '/users' + assert page.has_no_content? 'previous page' + assert page.has_content? 'next page' + within 'nav.pagination' do within 'span.page.current' do assert page.has_content? '1' @@ -27,6 +30,9 @@ class NavigationTest < Test::Unit::TestCase end end + assert page.has_content? 'previous page' + assert page.has_content? 'next page' + within 'nav.pagination' do within 'span.page.current' do assert page.has_content? '2' @@ -36,6 +42,9 @@ class NavigationTest < Test::Unit::TestCase end end + assert page.has_content? 'previous page' + assert page.has_no_content? 'next page' + within 'nav.pagination' do within 'span.page.current' do assert page.has_content? '4' @@ -45,6 +54,9 @@ class NavigationTest < Test::Unit::TestCase end end + assert page.has_content? 'previous page' + assert page.has_content? 'next page' + within 'nav.pagination' do within 'span.page.current' do assert page.has_content? '3'