This file contains 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
groups: | |
| id | data | | |
| 1 | foo | | |
| 2 | bar | | |
| 3 | baz | | |
memberships: | |
| id | group_id | user_id | |
This file contains 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
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') |
This file contains 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
class Post < ActiveRecord::Base | |
has_many :comments | |
attr_accessor :current_comment | |
end | |
class Comment < ActiveRecord::Base | |
module Foo | |
def and_set_current_comment |
This file contains 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
# ... | |
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' | |
This file contains 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
require File.dirname(__FILE__) + '/../../spec_helper' | |
describe Admin::BaseController do | |
subject do | |
Class.new(Admin::BaseController) do | |
def index; end | |
end.new | |
end | |
This file contains 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
try { | |
val conn = DriverManager.getConnection("jdbc:mysql://...") | |
// stuff | |
} catch { | |
case ex: SQLException => { | |
This file contains 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
val ids = List(1, 2, 3) | |
ids.foreach { id => | |
actor { | |
receiver ! getAvgSigFor(pool, id) | |
} | |
} | |
val sigs = getAvgSigsFor(ids) |
This file contains 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
# 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' |
This file contains 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
/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: |
This file contains 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
class Comment < ActiveRecord::Base | |
belongs_to :post | |
named_scope :by_quality, {:order => 'quality DESC'} | |
named_scope :by_created_at, {:order => 'created_at DESC'} | |
end |