-
-
Notifications
You must be signed in to change notification settings - Fork 365
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow factory_girl_rails to auto configure factory girl as the fixtur…
…e replacement mechanism.
- Loading branch information
1 parent
c7d54d2
commit 97222f2
Showing
4 changed files
with
51 additions
and
5 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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
@disable-bundler | ||
Feature: | ||
In order to not have to manually configure factory girl as the testing fixture replacement | ||
by using the --fixture-replacement=factory_girl option | ||
as a Rails3 and Factory Girl user | ||
I would like the Factory Girl Rails gem to configure Factory Girl | ||
as the fixture replacement. | ||
|
||
Background: | ||
Given I successfully run `bundle exec rails new testapp` | ||
And I cd to "testapp" | ||
And I add "factory_girl_rails" from this project as a dependency | ||
|
||
Scenario: Using Factory Girl and Factory Girl Rails with Test Unit generates | ||
a factory file and does not generate a fixture file | ||
And I successfully run `bundle install` | ||
And I successfully run `bundle exec rails generate model User name:string` | ||
Then the following files should exist: | ||
| test/factories/users.rb | | ||
And the following files should not exist: | ||
| test/fixtures/users.yml | | ||
|
||
|
||
Scenario: Using Factory Girl and Factory Girl Rails with RSpec should generate a factory file | ||
And I add "rspec-rails" as a dependency | ||
And I successfully run `bundle install` | ||
And I successfully run `bundle exec rails generate model User name:string` | ||
Then the following files should exist: | ||
| spec/factories/users.rb | | ||
And the following files should not exist: | ||
| spec/fixtures/users.yml | |
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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
When /^I add "([^"]+)" from this project as a dependency$/ do |gem_name| | ||
append_to_file('Gemfile', %{gem "#{gem_name}", :path => "#{PROJECT_ROOT}"}) | ||
append_to_file('Gemfile', %{gem "#{gem_name}", :path => "#{PROJECT_ROOT}"\n}) | ||
end | ||
|
||
When /^I add "([^"]+)" as a dependency$/ do |gem_name| | ||
append_to_file('Gemfile', %{gem "#{gem_name}"\n}) | ||
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