mirror of
https://github.com/kaminari/kaminari.git
synced 2022-11-09 13:44:37 -05:00
introducing Steak
This commit is contained in:
parent
0a06feeb97
commit
af61af9132
2 changed files with 38 additions and 20 deletions
|
@ -1,12 +1,43 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/acceptance_helper')
|
||||
|
||||
feature "Users", %q{
|
||||
In order to ...
|
||||
As a ...
|
||||
I want to ...
|
||||
} do
|
||||
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
|
||||
|
||||
scenario "Scenario name" do
|
||||
true.should == true
|
||||
within 'div.pagination' do
|
||||
within 'span.page.current' do
|
||||
page.should have_content '1'
|
||||
end
|
||||
within 'span.next' do
|
||||
click_link 'Next »'
|
||||
end
|
||||
end
|
||||
|
||||
within 'div.pagination' do
|
||||
within 'span.page.current' do
|
||||
page.should have_content '2'
|
||||
end
|
||||
within 'span.page.last' do
|
||||
click_link '4'
|
||||
end
|
||||
end
|
||||
|
||||
within 'div.pagination' do
|
||||
within 'span.page.current' do
|
||||
page.should have_content '4'
|
||||
end
|
||||
within 'span.prev' do
|
||||
click_link '« Prev'
|
||||
end
|
||||
end
|
||||
|
||||
within 'div.pagination' do
|
||||
within 'span.page.current' do
|
||||
page.should have_content '3'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
||||
|
||||
describe UsersController, 'pagination' do
|
||||
render_views
|
||||
before do
|
||||
1.upto(30) {|i| User.create! :name => "user#{'%02d' % i}" }
|
||||
end
|
||||
|
||||
it 'renders' do
|
||||
get :index
|
||||
response.body.should =~ /pagination/
|
||||
end
|
||||
end
|
Loading…
Add table
Reference in a new issue