Swap older/newer diary entries buttons

This commit is contained in:
Anton Khorev 2023-09-04 16:32:54 +03:00
parent b207cf78a3
commit 7e6de66444
2 changed files with 14 additions and 14 deletions

View file

@ -568,28 +568,28 @@ class DiaryEntriesControllerTest < ActionDispatch::IntegrationTest
assert_select "li.page-item.disabled span.page-link", :text => "Newer Entries", :count => 1
# Try and get the second page
get css_select("li.page-item a.page-link").first["href"]
get css_select("li.page-item .page-link").last["href"]
assert_response :success
assert_select "article.diary_post", :count => 20
assert_select "li.page-item a.page-link", :text => "Older Entries", :count => 1
assert_select "li.page-item a.page-link", :text => "Newer Entries", :count => 1
# Try and get the third page
get css_select("li.page-item a.page-link").first["href"]
get css_select("li.page-item .page-link").last["href"]
assert_response :success
assert_select "article.diary_post", :count => 10
assert_select "li.page-item.disabled span.page-link", :text => "Older Entries", :count => 1
assert_select "li.page-item a.page-link", :text => "Newer Entries", :count => 1
# Go back to the second page
get css_select("li.page-item a.page-link").last["href"]
get css_select("li.page-item .page-link").first["href"]
assert_response :success
assert_select "article.diary_post", :count => 20
assert_select "li.page-item a.page-link", :text => "Older Entries", :count => 1
assert_select "li.page-item a.page-link", :text => "Newer Entries", :count => 1
# Go back to the first page
get css_select("li.page-item a.page-link").last["href"]
get css_select("li.page-item .page-link").first["href"]
assert_response :success
assert_select "article.diary_post", :count => 20
assert_select "li.page-item a.page-link", :text => "Older Entries", :count => 1