Skip to content

Instantly share code, notes, and snippets.

View agibralter's full-sized avatar
:shipit:

Aaron Gibralter agibralter

:shipit:
View GitHub Profile
groups:
| id | data |
| 1 | foo |
| 2 | bar |
| 3 | baz |
memberships:
| id | group_id | user_id |
it "should display the enter link" do
helper.actions_for(@context).should have_tag('a', 'enter')
end
it "should not display the join link" do
helper.actions_for(@context).should_not have_tag('a', 'join')
end
it "should not display the cancel link" do
helper.actions_for(@context).should_not have_tag('a', 'cancel')
class Post < ActiveRecord::Base
has_many :comments
attr_accessor :current_comment
end
class Comment < ActiveRecord::Base
module Foo
def and_set_current_comment
# ...
Scenario: having current questions in multiple urtaks
Given ...
And b has seen a question in 'cat'
And b has seen a question in 'dog'
When b goes to '/about'
Then b should see the same question in 'cat'
And b should see the same question in 'dog'
require File.dirname(__FILE__) + '/../../spec_helper'
describe Admin::BaseController do
subject do
Class.new(Admin::BaseController) do
def index; end
end.new
end
try {
val conn = DriverManager.getConnection("jdbc:mysql://...")
// stuff
} catch {
case ex: SQLException => {
val ids = List(1, 2, 3)
ids.foreach { id =>
actor {
receiver ! getAvgSigFor(pool, id)
}
}
val sigs = getAvgSigsFor(ids)
# like reddit's sub-reddits located @ reddit.com/r/[name_of_reddit]
map.namespace :c, :path_prefix => 'c/:context_name' do |c|
c.default '', :controller => 'dashboards', :action => 'show'
c.resources :posts
c.resources :votes
c.namespace :admin do |c_admin|
c_admin.default '', :controller => 'dashboards', :action => 'show'
/opt/local/bin/ruby /opt/local/lib/ruby/gems/1.8/gems/rspec-1.2.2/bin/spec --autospec spec/controllers/password_resets_controller_spec.rb -O spec/spec.opts
F..
1)
NoMethodError in 'PasswordResetsController PUT /password_resets/update re-renders the 'edit' template'
You have a nil object when you didn't expect it!
You might have expected an instance of ActiveRecord::Base.
The error occurred while evaluating nil.[]
/Users/jeff/development/urlagg/app/controllers/password_resets_controller.rb:27:in `update'
./spec/controllers/password_resets_controller_spec.rb:26:
class Comment < ActiveRecord::Base
belongs_to :post
named_scope :by_quality, {:order => 'quality DESC'}
named_scope :by_created_at, {:order => 'created_at DESC'}
end