Skip to content

Instantly share code, notes, and snippets.

@maasha
Created Apr 8, 2013
Embed
What would you like to do?
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
Scaffold.all.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