Skip to content

Commit

Permalink
Test has_many with attributes_for
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuaclayton committed Apr 17, 2012
1 parent 89d5e94 commit 50be545
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions spec/acceptance/attributes_for_spec.rb
Expand Up @@ -5,22 +5,28 @@


before do before do
define_model('User') define_model('User')
define_model('Comment')


define_model('Post', title: :string, define_model('Post', title: :string,
body: :string, body: :string,
summary: :string, summary: :string,
user_id: :integer) do user_id: :integer) do
belongs_to :user belongs_to :user
has_many :comments
end end


FactoryGirl.define do FactoryGirl.define do
factory :user factory :user
factory :comment


factory :post do factory :post do
title { "default title" } title { "default title" }
body { "default body" } body { "default body" }
summary { title } summary { title }
user user
comments do |c|
[c.association(:comment)]
end
end end
end end
end end
Expand Down

0 comments on commit 50be545

Please sign in to comment.