Skip to content

Instantly share code, notes, and snippets.

@netzfisch
Created May 18, 2013 21:08
Show Gist options
  • Save netzfisch/5605792 to your computer and use it in GitHub Desktop.
Save netzfisch/5605792 to your computer and use it in GitHub Desktop.
working example of testing "will_paginate" view helper
require 'will_paginate/array'
describe "recurrences/index" do
let(:recurrences) do [
FactoryGirl.build(:recurrence, scheduled_to: "2012-07-05"),
FactoryGirl.build(:recurrence, scheduled_to: "2012-07-12"),
FactoryGirl.build(:recurrence, scheduled_to: "2012-07-19")
]
end
it "should have a pagination bar" do
assign(:recurrences, recurrences.paginate(per_page: 2))
render
expect(rendered).to have_selector("div.pagination")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment