Skip to content

Instantly share code, notes, and snippets.

# sudo gem install faker
desc "Load db with test data"
task :lorem => ['db:reset', :environment] do
require 'factory_girl'
require 'faker'
Factory.define :lorem_post, :class => :post do |post|
post.title { Faker::Lorem.sentence }
post.body { Faker::Lorem.paragraphs.join(' ') }
Scenario: Viewing events atom feed
Given a future special event exists with a title of "Barcamp Boston"
Given a future recurring event exists with a title of "Hackfest"
When I go to events.atom
Then I should see an entry for "Barcamp Boston"
And I should see an entry for "Hackfest"
Then /^I should not see an entry for for "(.*)"$/ do |title|
assert_select 'events event title', :text => title, :count => 0
end
# Standard cascade of JSON dependencies.
# Cascades from fastest performing & hardest dependency management (odd C libraries)
# to slowest performing & easiest dependency management (pure Ruby)
# Meant for libraries like TwitterSearch & LeGit
def cascade_require(*libs)
require libs.shift.to_s
rescue LoadError
libs.empty? ? raise : retry
end
njero - http://neverlet.be
sutto - http://blog.ninjahideout.com
zapnap - http://blog.zerosum.org
tpope - http://tpope.net
reinh - http://reinh.com
bryanl - http://smartic.us
linoj - http://www.vaporbase.com
technicalpickles - http://technicalpickles.com
MaD15 - enlightsolutions.com/
qrush - http://litanyagainstfear.com/