Skip to content

Instantly share code, notes, and snippets.

@emileswarts
Created February 18, 2015 15:54
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 emileswarts/8d8706ec797211a4e408 to your computer and use it in GitHub Desktop.
Save emileswarts/8d8706ec797211a4e408 to your computer and use it in GitHub Desktop.
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