Skip to content

Instantly share code, notes, and snippets.

View zapnap's full-sized avatar

nap zapnap

View GitHub Profile
def foo
puts 'foo'
end
def foobar
puts "hallo there"
end
module Foo
module Bar
def self.test
puts "hallo"
end
end
end
Alright, Rumblers... so the *official contest dates*, in case you haven't already heard from the rumor mill (or the twittersphere), are:
October 18th and 19th.
It turns out that the proposed dates that we mentioned in the last broadcast were in conflict with another Rails related event, so we've chosen this date to be as conflict-free as possible. It is *final* at this point and we sincerely hope that it works for everyone who wants to participate.
In other news, event plans are rolling full steam ahead. The blog is now online at http://blog.railsrumble.com, featuring a new theme courtesy of CarlKingCreative. Thanks Carl! Within the next couple of days, we'll be announcing a number of event sponsors who have come on board, as well as more details about registration for the contest. Please subscribe to the blog feed in order to get the latest and greatest news. We'll be keeping list traffic quiet again until registration details are announced.
Best,
describe 'ratings' do
before(:each) do
@user = users(:quentin)
@precious = mock_model(Song, :id => 1)
@rating = mock_model(Rating)
@user.stub!(:ratings).and_return([])
end
it 'loves the precious' do
@user.ratings.should_receive(:find_or_create_by_song_id).with(1).and_return(@rating)
<!-- ugly ugly ugly --->
<li class="rating-5"><a href="http://localhost:3000/teams/foobar-patrol/rate/completeness/5" onclick="var f = document.createElement('form'); f.style.display = 'none'; this.parentNode.appendChild(f); f.method = 'POST'; f.action = this.href;var m = document.createElement('input'); m.setAttribute('type', 'hidden'); m.setAttribute('name', '_method'); m.setAttribute('value', 'put'); f.appendChild(m);var s = document.createElement('input'); s.setAttribute('type', 'hidden'); s.setAttribute('name', 'authenticity_token'); s.setAttribute('value', '2a1475f507de8460df36c0fdf0fa588420e87195'); f.appendChild(s);f.submit();return false;" title="Rate this 5 stars out of 5">5</a></li></ul>
describe Notifications do
# ...
it "should send a rating invitation email" do
@user = Factory.build(:user)
mail = Notifications.create_rating_invite(@user)
mail.to.should include(@user.email)
mail.body.should match(/#{@user.to_param}/)
end
end
# -*- apache -*-
# Leopard (10.5) Apache 2 configuration for Validator S.A.C. installed in /Applications
# First, tell httpd that check_wrapper.sh and sendfeedback_wrapper.sh are CGI scripts.
ScriptAlias /w3c-validator/check '/Applications/Validator-SAC.app/Contents/Resources/validator/httpd/cgi-bin/check_wrapper.sh'
ScriptAliasMatch /w3c-validator/feedback(\.html)? '/Applications/Validator-SAC.app/Contents/Resources/validator/httpd/cgi-bin/sendfeedback_wrapper.sh'
<Directory "/Applications/Validator-SAC.app/Contents/Resources/validator/httpd/cgi-bin">
AllowOverride None
Let's make a list of Sinatra-based apps!
Apps:
- http://github.com/cschneid/irclogger "Sinatra based irclogger.com"
- http://github.com/rtomayko/wink "minimalist blogging engine"
- http://github.com/foca/integrity "The easy and fun Continuous Integration server"
- http://github.com/sr/git-wiki "git-powered wiki"
- http://github.com/entp/seinfeld "Seinfeld-inspired productivity calendar to track your public github commits."
- http://github.com/karmi/marley "Marley, the blog engine without <textareas>."
- http://github.com/ichverstehe/gaze "Serve up your Markdown files with this tiny Sinatra app!"
specify 'should retrieve artists for typeahead filtering' do
Artist.should_receive(:all).with(:limit => SiteConfig.max_artists, :name.like => '%ab%').and_return(@artists)
get '/artists.json', :q => 'ab'
end
Spec::Mocks::MockExpectationError in 'main application /artists.json should retrieve artists for typeahead filtering'
<Artist (class)> expected :all with ({#<DataMapper::Query::Operator:0x2526b2c @operator=:like, @target=:name>=>"%ab%", :limit=>500}) but received it with ({#<DataMapper::Query::Operator:0x2525380 @operator=:like, @target=:name>=>"%ab%", :limit=>500})