Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
MYSQL
When(/^I visit comment page (\d+)$/) do |page|
CacheSweeper.stub(expire_cache: nil)
CommentSweeper.any_instance.stub(clear_cache: nil)
10.times { News::Item.first.comments << FactoryGirl.build(:comment, published: true)
p News::Item.first.comments.where('published = ?', true).page(page).per(Comment.config.per_page).map(&:id)
en
=> [16, 15, 14]
SQLITE3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment