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
# install phantomjs using Homebrew (http://mxcl.github.com/homebrew/) | |
# by running `brew install phantomjs` then run this script with `phantomjs screenshot.coffee` | |
page = require('webpage').create() | |
page.viewportSize = { width: 768, height: 600 } | |
page.open 'http://bridgidgallagher.com/blog', (status) -> | |
console.log status | |
window.setTimeout -> | |
console.log "render" |
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
describe "Pages" do | |
# a trivial example that follows a link from "Page A" to "Page B" | |
shared_examples "an example page" do | |
it "should follow link from Page A to Page B" do | |
visit page_a_path | |
click_link "Link to B" | |
page.should have_content("Page B") | |
current_path.should == page_b_path | |
end |
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
# when I call Thing.count, it works and DISTINCT records are selected | |
# when I call Thing.scoped.count (or any other query), it doesn't work | |
class Thing < ActiveRecord::Base | |
class << self | |
def count_with_distinct | |
count_without_distinct(:distinct => true) | |
end | |
alias_method_chain :count, :distinct | |
end |
NewerOlder