Skip to content

Instantly share code, notes, and snippets.

View triskweline's full-sized avatar

Henning Koch triskweline

View GitHub Profile
Foo Bar
---
Bar bam

You Look Nice Today

A sample application for our Rails workshop

This is the demo application for our Rails Workshop, a yearly event held by makandra to tell students about the Ruby on Rails framework and test-driven development.

# Headline 1
## Headline 2
### Headline 3
#### Headline 4
xml.instruct!
xml.rss :version => '2.0', 'xmlns:atom' => 'http://www.w3.org/2005/Atom' do
xml.channel do
xml.title "makandra cards for #{@user.public_name}"
xml.link sites_url
xml.language 'en'
xml.tag! 'atom:link', :rel => 'self', :type => 'application/rss+xml', :href => sites_url
for note in @notes
@triskweline
triskweline / contact_spec.rb
Created July 5, 2012 21:20
Production example where factories are useful vs. a global set of fixtures.
describe Contract do
describe '.overlapping' do
it 'should match a contract partially overlapping the given contract' do
match = Contract.make(:start_date => Date.today + 5, :end_date => Date.today + 10)
given = Contract.new(:start_date => Date.today + 7, :end_date => Date.today + 12)
Contract.overlapping(given).all.should == [match]
end
# Copy this to features/support/ssl_fix.rb to make Capybara work with sites that switch between HTTP and HTTPS
module Capybara::Driver::RackTest::SslFix
[:get, :post, :put, :delete].each do |method|
define_method method do |*args|
args[0] = path_to_ssl_aware_url(args[0])
super(*args)
end
end