Skip to content

Instantly share code, notes, and snippets.

@ravelll
Created September 29, 2014 10:48
Show Gist options
  • Save ravelll/eeee5dc0ebdb83a80c38 to your computer and use it in GitHub Desktop.
Save ravelll/eeee5dc0ebdb83a80c38 to your computer and use it in GitHub Desktop.
ヒント 10-5-2
describe "pagination" do
before(:each) do
sign_in user
visit users_path
end
context 'When user has 30 microposts' do
let!(:Micropost) { 30.times { FactoryGirl.create(:micropost, user: user) } }
# micropost にあたるタグが30個ある
# 次へボタンがない
end
context 'When user has more than 30 microposts' do
let!(:Micropost) { 31.times { FactoryGirl.create(:micropost, user: user) } }
# 1ページ目に行く
# micropost にあたるタグが30個ある
# 次へボタンが有る
# 2ページ目に行く
# micropost にあたるタグが1個ある
# 戻るボタンが有る
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment