1
0
Fork 0
mirror of https://github.com/kaminari/kaminari.git synced 2022-11-09 13:44:37 -05:00
kaminari--kaminari/spec/requests/users_spec.rb

54 lines
1.1 KiB
Ruby
Raw Normal View History

# encoding: UTF-8
require 'spec_helper'
2011-02-07 08:37:31 -05:00
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
2011-12-10 12:56:19 -05:00
visit '/users'
2011-02-07 21:21:39 -05:00
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 '
2011-02-07 21:21:39 -05:00
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.last' do
click_link 'Last »'
2011-02-07 21:21:39 -05:00
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'
2011-02-07 21:21:39 -05:00
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
within 'span.first' do
click_link '« First'
end
end
within 'nav.pagination' do
within 'span.page.current' do
page.should have_content '1'
end
2011-02-07 21:21:39 -05:00
end
2011-02-07 08:37:31 -05:00
end
end