Skip to content

Instantly share code, notes, and snippets.

@croaky
Forked from jferris/new.rb
Created November 9, 2010 18:56
Show Gist options
  • Save croaky/669586 to your computer and use it in GitHub Desktop.
Save croaky/669586 to your computer and use it in GitHub Desktop.
describe Message do
FactoryGirl.create :account, :name => "My Account" do
create :user
create :project do
build :message, :author => :user
end
end
# examples
end
describe Message do
let!(:account) { Factory(:account, :name => "My Account") }
let!(:user) { Factory(:user, :account => account) }
let!(:project) { Factory(:project, :account => account) }
let!(:message) { Factory(:message, :account => account,
:project => project,
:author => user) }
# examples
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment