introducing Steak

This commit is contained in:
Akira Matsuda 2011-02-08 11:21:39 +09:00
parent 0a06feeb97
commit af61af9132
2 changed files with 38 additions and 20 deletions

View File

@ -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

View File

@ -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