2011-02-19 06:50:55 -05:00
|
|
|
# encoding: UTF-8
|
2011-02-07 08:37:31 -05:00
|
|
|
require File.expand_path(File.dirname(__FILE__) + '/acceptance_helper')
|
|
|
|
|
2011-02-07 21:21:39 -05:00
|
|
|
feature 'Users' do
|
|
|
|
background do
|
|
|
|
1.upto(100) {|i| User.create! :name => "user#{'%03d' % i}" }
|
|
|
|
end
|
|
|
|
scenario 'navigating by pagination links' do
|
|
|
|
visit users_path
|
|
|
|
|
2011-02-07 21:25:43 -05:00
|
|
|
within 'nav.pagination' do
|
2011-02-07 21:21:39 -05:00
|
|
|
within 'span.page.current' do
|
|
|
|
page.should have_content '1'
|
|
|
|
end
|
|
|
|
within 'span.next' do
|
|
|
|
click_link 'Next »'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2011-02-07 21:25:43 -05:00
|
|
|
within 'nav.pagination' do
|
2011-02-07 21:21:39 -05:00
|
|
|
within 'span.page.current' do
|
|
|
|
page.should have_content '2'
|
|
|
|
end
|
|
|
|
within 'span.page.last' do
|
|
|
|
click_link '4'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2011-02-07 21:25:43 -05:00
|
|
|
within 'nav.pagination' do
|
2011-02-07 21:21:39 -05:00
|
|
|
within 'span.page.current' do
|
|
|
|
page.should have_content '4'
|
|
|
|
end
|
|
|
|
within 'span.prev' do
|
|
|
|
click_link '« Prev'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2011-02-07 21:25:43 -05:00
|
|
|
within 'nav.pagination' do
|
2011-02-07 21:21:39 -05:00
|
|
|
within 'span.page.current' do
|
|
|
|
page.should have_content '3'
|
|
|
|
end
|
|
|
|
end
|
2011-02-07 08:37:31 -05:00
|
|
|
end
|
|
|
|
end
|