Created
May 18, 2013 21:08
-
-
Save netzfisch/5605792 to your computer and use it in GitHub Desktop.
working example of testing "will_paginate" view helper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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