Skip to content

Commit

Permalink
Move spec fabricators into separate files
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Elliott committed May 29, 2011
1 parent 51bb967 commit cc14605
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 31 deletions.
9 changes: 9 additions & 0 deletions spec/fabricators/active_record_fabricator.rb
@@ -0,0 +1,9 @@
# ActiveRecord Objects
Fabricator(:division) do
name "Division Name"
end

Fabricator(:squadron, :from => :division)

Fabricator(:company)
Fabricator(:startup, :from => :company)
19 changes: 19 additions & 0 deletions spec/fabricators/mongoid_fabricator.rb
@@ -0,0 +1,19 @@
# Mongoid Documents
Fabricator(:author) do
name 'George Orwell'
books(:count => 4) do |author, i|
Fabricate.build(:book, :title => "book title #{i}", :author => author)
end
end

Fabricator(:hemingway, :from => :author) do
name 'Ernest Hemingway'
end

Fabricator(:book) do
title "book title"
end

Fabricator(:publishing_house)
Fabricator(:book_promoter)
Fabricator(:professional_affiliation)
Expand Up @@ -37,34 +37,3 @@
Fabricator("Something::Amazing") do
stuff "cool"
end

# ActiveRecord Objects
Fabricator(:division) do
name "Division Name"
end

Fabricator(:squadron, :from => :division)

Fabricator(:company)
Fabricator(:startup, :from => :company)


# Mongoid Documents
Fabricator(:author) do
name 'George Orwell'
books(:count => 4) do |author, i|
Fabricate.build(:book, :title => "book title #{i}", :author => author)
end
end

Fabricator(:hemingway, :from => :author) do
name 'Ernest Hemingway'
end

Fabricator(:book) do
title "book title"
end

Fabricator(:publishing_house)
Fabricator(:book_promoter)
Fabricator(:professional_affiliation)

0 comments on commit cc14605

Please sign in to comment.