spec/features/search_pagination_spec.rb in blacklight-8.2.2 vs spec/features/search_pagination_spec.rb in blacklight-8.3.0
- old
+ new
@@ -2,42 +2,42 @@
RSpec.describe "Search Pagination" do
it "has results with pagination" do
visit root_path
fill_in "q", with: ''
- click_button 'search'
+ click_on 'search'
within ("#sortAndPerPage") do
expect(page).to have_content "1 - 10 of "
within '#per_page-dropdown' do
expect(page).to have_link('10')
expect(page).to have_link('20')
expect(page).to have_link('50')
expect(page).to have_link('100')
end
end
within '#sortAndPerPage' do
- click_link "Next »"
+ click_on "Next »"
end
within "#sortAndPerPage" do
expect(page).to have_content "11 - 20 of "
- click_link "« Previous"
+ click_on "« Previous"
end
within "#sortAndPerPage" do
expect(page).to have_content "1 - 10 of "
end
end
it "is able to change the number of items per page" do
visit root_path
fill_in "q", with: ''
- click_button 'search'
+ click_on 'search'
within ("#sortAndPerPage") do
expect(page).to have_content "1 - 10 of "
end
within ("#per_page-dropdown") do
- click_link '20'
+ click_on '20'
end
within ("#sortAndPerPage") do
expect(page).to have_content "1 - 20 of "
end
end
@@ -57,38 +57,38 @@
end
it "uses the configured values" do
visit root_path
fill_in "q", with: ''
- click_button 'search'
+ click_on 'search'
within ("#sortAndPerPage") do
expect(page).to have_content "1 - 15 of "
within '#per_page-dropdown' do
expect(page).to have_link('15')
expect(page).to have_link('30')
end
end
within ("#per_page-dropdown") do
- click_link '30'
+ click_on '30'
end
within ("#sortAndPerPage") do
expect(page).to have_content "1 - 30 of "
end
end
end
it "resets the page offset to 1 when changing per page" do
visit root_path
fill_in "q", with: ''
- click_button 'search'
+ click_on 'search'
within "#sortAndPerPage" do
- click_link "Next »"
+ click_on "Next »"
end
within "#sortAndPerPage" do
expect(page).to have_content "11 - 20 of "
end
within ("#per_page-dropdown") do
- click_link '20'
+ click_on '20'
end
within "#sortAndPerPage" do
expect(page).to have_content "1 - 20 of "
end
end