forked from thoughtbot/factory_bot
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't require a block to be passed when defining a factory
- Loading branch information
1 parent
90ea1fe
commit 4d8d419
Showing
9 changed files
with
25 additions
and
17 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,8 +10,7 @@ | |
end | ||
|
||
FactoryGirl.define do | ||
factory :user do | ||
end | ||
factory :user | ||
|
||
factory :post do | ||
user | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,8 +12,7 @@ | |
end | ||
|
||
FactoryGirl.define do | ||
factory :user do | ||
end | ||
factory :user | ||
|
||
factory :post do | ||
user | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,8 +12,7 @@ | |
end | ||
|
||
FactoryGirl.define do | ||
factory :user do | ||
end | ||
factory :user | ||
|
||
factory :post do | ||
user | ||
|
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
require 'spec_helper' | ||
require 'acceptance/acceptance_helper' | ||
|
||
describe "an instance generated by a factory" do | ||
before do | ||
define_model("User") | ||
|
||
FactoryGirl.define do | ||
factory :user | ||
end | ||
end | ||
|
||
it "registers the user factory" do | ||
FactoryGirl.factory_by_name(:user).should be_a(FactoryGirl::Factory) | ||
end | ||
end |