Skip to content
This repository was archived by the owner on Mar 24, 2020. It is now read-only.

Commit 765ad28

Browse files
committed
Updating feature test to fail because pager is still displayed on direct linked pages
1 parent 2312768 commit 765ad28

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

spec/features/catalog_spec.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,20 @@
116116
expect(page).to have_selector('h3', :text => 'Sample Object 2')
117117
expect(page).to have_selector('h3', :text => 'Sample Object 3')
118118

119-
expect(page).to have_selector('div', :text => 'Results 1 - 3 of 3')
119+
# viewing item from search results should have pager
120120
click_on "Sample Object 2"
121+
expect(page).to have_selector('div', :text => 'Previous 2 of 3 results Next')
121122
expect(page).to have_link('Previous', href: dams_object_path(@obj1, counter: 1) )
122123
expect(page).to have_link('Next', href: dams_object_path(@obj3, counter: 3) )
123124

125+
# pager should remain when paging through results
124126
click_on "Next"
125127
expect(page).to have_link('Previous', href: dams_object_path(@obj2, counter: 2) )
128+
expect(page).to have_selector('div', :text => 'Previous 3 of 3 results')
129+
130+
# should not have pager on direct links
131+
visit dams_object_path @obj1
132+
expect(page).to_not have_selector('div', :text => 'Previous 3 of 3 results')
126133
end
127134
end
128135

0 commit comments

Comments
 (0)