Skip to content

Instantly share code, notes, and snippets.

@maasha
Created April 8, 2013 09:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maasha/5335637 to your computer and use it in GitHub Desktop.
Save maasha/5335637 to your computer and use it in GitHub Desktop.
1) Scaffold pages index pagination Failure/Error: it { should have_selector('div.pagination') } # FIXME expected css "div.pagination" to return something # ./spec/requests/scaffold_pages_spec.rb:27:in `block (4 levels) in <top (required)>'
require 'spec_helper'
describe "Scaffold pages" do
subject { page }
describe "index" do
let(:user) { FactoryGirl.create(:user) }
before do
sign_in user
30.times { FactoryGirl.create(:scaffold, user: user) }
visit user_scaffolds_path(user)
end
it { should have_selector('title', text: 'All scaffolds') }
it { should have_selector('h1', text: 'All scaffolds') }
it "should list each scaffold" do
user.scaffolds.each do |scaffold|
page.should have_selector('li', text: scaffold.name)
end
end
describe "pagination" do
it { should have_selector('div.pagination') } # FIXME
it "should list each scaffold" do
user.scaffolds.paginate(page: 1).each do |scaffold|
page.should have_selector('li', text: scaffold.name)
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment