/
fixture_replacement_config.feature
74 lines (66 loc) · 3.42 KB
/
fixture_replacement_config.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
@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 |
Scenario: Using Factory Girl and Factory Girl Rails does not override a manually-configured factories directory using RSpec
When I add "rspec-rails" as a dependency
And I configure the factories directory as "custom/dir"
And I successfully run `bundle install`
And I successfully run `bundle exec rails generate model User name:string`
Then the following files should not exist:
| test/factories/users.rb |
| spec/factories/users.rb |
But the following files should exist:
| custom/dir/users.rb |
Scenario: Using Factory Girl and Factory Girl Rails does not override a manually-configured factories directory using Test::Unit
When I configure the factories directory as "custom/dir"
And I successfully run `bundle install`
And I successfully run `bundle exec rails generate model User name:string`
Then the following files should not exist:
| test/factories/users.rb |
| spec/factories/users.rb |
But the following files should exist:
| custom/dir/users.rb |
Scenario: Using Factory Girl and Factory Girl Rails with MiniTest should generate a factory file
When I add "minitest" as a dependency
And I configure the testing framework to use MiniTest
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 |
But the following files should not exist:
| spec/fixtures/users.yml |
Scenario: Using Factory Girl and Factory Girl Rails with MiniTest and a custom directory should generate a factory file
When I configure the factories directory as "custom/dir"
And I add "minitest" as a dependency
And I configure the testing framework to use MiniTest
And I successfully run `bundle install`
And I successfully run `bundle exec rails generate model User name:string`
Then the following files should exist:
| custom/dir/users.rb |
But the following files should not exist:
| spec/fixtures/users.yml |
And the file "test/models/user_test.rb" should contain "MiniTest::Rails::ActiveSupport::TestCase"