Skip to content

Instantly share code, notes, and snippets.

=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click_on('Link Text') # Click either a link or a button
click_on('Button Value')
@thorn
thorn / paginated_collection.js.coffee
Created May 17, 2012 09:56 — forked from zerowidth/paginated_collection.js
backbone pagination with coffeescript
# coffeescript rules
# Pagination is sticked with model
#
# Server should response in that way:
# {
# articles: [{category_id:null, id:308,…}, {category_id:null, id:307,…}, {category_id:null, id:306,…},…]
# pagination: {total:34, page:2, per_page:15, cat_id:-1, source_id:-1}
# }
# To achieve this controller should look like (using will_paginate gem):
# per_page = params[:per_page].to_i || 15