factory_bot_rails 4.10.0 → 4.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/NEWS +3 -0
- data/README.md +23 -12
- metadata +6 -27
- data/Appraisals +0 -21
- data/Gemfile +0 -20
- data/Gemfile.lock +0 -144
- data/Rakefile +0 -24
- data/bin/setup +0 -16
- data/factory_bot_rails.gemspec +0 -20
- data/factory_girl_rails.gemspec +0 -20
- data/features/fixture_replacement_config.feature +0 -132
- data/features/generators.feature +0 -54
- data/features/load_definitions.feature +0 -85
- data/features/step_definitions/appraisal.rb +0 -5
- data/features/step_definitions/rails_steps.rb +0 -42
- data/features/support/env.rb +0 -21
- data/gemfiles/rails3.2.gemfile +0 -22
- data/gemfiles/rails3.2.gemfile.lock +0 -186
- data/gemfiles/rails4.1.gemfile +0 -23
- data/gemfiles/rails4.1.gemfile.lock +0 -181
- data/gemfiles/rails4.2.gemfile +0 -21
- data/gemfiles/rails4.2.gemfile.lock +0 -189
- data/gemfiles/rails5.0.gemfile +0 -22
- data/gemfiles/rails5.0.gemfile.lock +0 -156
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6c176586fd5ac8ded39724dcf04f8e0674ec1ba9c669ddc10ce893f44cb0350
|
4
|
+
data.tar.gz: c05e2dd96153e4e063972526c5280c228587bcd3452d3f087f783d87a9f7a42a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2f46b38d38d3201e7cc5f426cc2870781d0fcfe86fddf638aca06df21022be53b56638f678e9631cea81d32231e6438a1e5c92fb8e342448831553bf14b0af8
|
7
|
+
data.tar.gz: 56f03496f20ab91933d873d5ac57e0e9d02d779215fafa50b9a1fb687b806198b3e80779a780055fc7a0dd60e73f85d7d7101b87413a4b9af5446e2f39e6dd0f
|
data/NEWS
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# factory_bot_rails [![Build Status][ci-image]][ci] [![Code Climate][grade-image]][grade]
|
1
|
+
# factory_bot_rails [![Build Status][ci-image]][ci] [![Code Climate][grade-image]][grade] [![Gem Version][version-image]][version] [![Reviewed by Hound][hound-image]][hound]
|
2
2
|
|
3
3
|
[factory_bot][fb] is a fixtures replacement with a straightforward definition
|
4
4
|
syntax, support for multiple build strategies (saved instances, unsaved
|
@@ -75,15 +75,9 @@ You may need to configure your test suite to include factory_bot methods; see
|
|
75
75
|
|
76
76
|
Please see [CONTRIBUTING.md](CONTRIBUTING.md).
|
77
77
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
![thoughtbot](http://thoughtbot.com/images/tm/logo.png)
|
83
|
-
|
84
|
-
factory_bot is maintained and funded by [thoughtbot, inc](http://thoughtbot.com/community)
|
85
|
-
|
86
|
-
The names and logos for thoughtbot are trademarks of thoughtbot, inc.
|
78
|
+
factory_bot_rails was originally written by Joe Ferris and is now maintained by Josh
|
79
|
+
Clayton. Many improvements and bugfixes were contributed by the [open source
|
80
|
+
community](https://github.com/thoughtbot/factory_bot_rails/graphs/contributors).
|
87
81
|
|
88
82
|
## License
|
89
83
|
|
@@ -91,8 +85,25 @@ factory_bot_rails is Copyright © 2008-2016 Joe Ferris and thoughtbot. It is fre
|
|
91
85
|
software, and may be redistributed under the terms specified in the
|
92
86
|
[LICENSE](LICENSE) file.
|
93
87
|
|
88
|
+
## About thoughtbot
|
89
|
+
|
90
|
+
![thoughtbot](https://thoughtbot.com/logo.png)
|
91
|
+
|
92
|
+
factory_bot_rails is maintained and funded by thoughtbot, inc.
|
93
|
+
The names and logos for thoughtbot are trademarks of thoughtbot, inc.
|
94
|
+
|
95
|
+
We are passionate about open source software.
|
96
|
+
See [our other projects][community].
|
97
|
+
We are [available for hire][hire].
|
98
|
+
|
94
99
|
[fb]: https://github.com/thoughtbot/factory_bot
|
95
100
|
[ci]: http://travis-ci.org/thoughtbot/factory_bot_rails?branch=master
|
96
|
-
[ci-image]: https://secure.travis-ci.org/thoughtbot/factory_bot_rails.
|
101
|
+
[ci-image]: https://secure.travis-ci.org/thoughtbot/factory_bot_rails.svg
|
97
102
|
[grade]: https://codeclimate.com/github/thoughtbot/factory_bot_rails
|
98
|
-
[grade-image]: https://codeclimate.com/github/thoughtbot/factory_bot_rails.
|
103
|
+
[grade-image]: https://codeclimate.com/github/thoughtbot/factory_bot_rails.svg
|
104
|
+
[community]: https://thoughtbot.com/community?utm_source=github
|
105
|
+
[hire]: https://thoughtbot.com/hire-us?utm_source=github
|
106
|
+
[version-image]: https://badge.fury.io/rb/factory_bot_rails.svg
|
107
|
+
[version]: https://badge.fury.io/rb/factory_bot_rails
|
108
|
+
[hound-image]: https://img.shields.io/badge/Reviewed_by-Hound-8E64B0.svg
|
109
|
+
[hound]: https://houndci.com
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: factory_bot_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joe Ferris
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-08-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 4.
|
33
|
+
version: 4.11.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 4.
|
40
|
+
version: 4.11.0
|
41
41
|
description: |-
|
42
42
|
factory_bot_rails provides integration between
|
43
43
|
factory_bot and rails 3 or newer (currently just automatic factory definition
|
@@ -47,31 +47,10 @@ executables: []
|
|
47
47
|
extensions: []
|
48
48
|
extra_rdoc_files: []
|
49
49
|
files:
|
50
|
-
- Appraisals
|
51
50
|
- CONTRIBUTING.md
|
52
|
-
- Gemfile
|
53
|
-
- Gemfile.lock
|
54
51
|
- LICENSE
|
55
52
|
- NEWS
|
56
53
|
- README.md
|
57
|
-
- Rakefile
|
58
|
-
- bin/setup
|
59
|
-
- factory_bot_rails.gemspec
|
60
|
-
- factory_girl_rails.gemspec
|
61
|
-
- features/fixture_replacement_config.feature
|
62
|
-
- features/generators.feature
|
63
|
-
- features/load_definitions.feature
|
64
|
-
- features/step_definitions/appraisal.rb
|
65
|
-
- features/step_definitions/rails_steps.rb
|
66
|
-
- features/support/env.rb
|
67
|
-
- gemfiles/rails3.2.gemfile
|
68
|
-
- gemfiles/rails3.2.gemfile.lock
|
69
|
-
- gemfiles/rails4.1.gemfile
|
70
|
-
- gemfiles/rails4.1.gemfile.lock
|
71
|
-
- gemfiles/rails4.2.gemfile
|
72
|
-
- gemfiles/rails4.2.gemfile.lock
|
73
|
-
- gemfiles/rails5.0.gemfile
|
74
|
-
- gemfiles/rails5.0.gemfile.lock
|
75
54
|
- lib/factory_bot_rails.rb
|
76
55
|
- lib/factory_bot_rails/generator.rb
|
77
56
|
- lib/factory_bot_rails/generators/non_rspec_generator.rb
|
@@ -80,7 +59,7 @@ files:
|
|
80
59
|
- lib/factory_bot_rails/railtie.rb
|
81
60
|
- lib/generators/factory_bot.rb
|
82
61
|
- lib/generators/factory_bot/model/model_generator.rb
|
83
|
-
homepage:
|
62
|
+
homepage: https://github.com/thoughtbot/factory_bot_rails
|
84
63
|
licenses:
|
85
64
|
- MIT
|
86
65
|
metadata: {}
|
@@ -100,7 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
100
79
|
version: '0'
|
101
80
|
requirements: []
|
102
81
|
rubyforge_project:
|
103
|
-
rubygems_version: 2.7.
|
82
|
+
rubygems_version: 2.7.7
|
104
83
|
signing_key:
|
105
84
|
specification_version: 4
|
106
85
|
summary: factory_bot_rails provides integration between factory_bot and rails 3 or
|
data/Appraisals
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
# These are the versions of Rails we want to test against.
|
2
|
-
appraise 'rails3.2' do
|
3
|
-
gem 'rails', '~> 3.2.21'
|
4
|
-
gem 'sass-rails'
|
5
|
-
end
|
6
|
-
|
7
|
-
appraise 'rails4.1' do
|
8
|
-
gem 'rails', '~> 4.1.9'
|
9
|
-
gem 'sass-rails'
|
10
|
-
gem 'spring'
|
11
|
-
end
|
12
|
-
|
13
|
-
appraise 'rails4.2' do
|
14
|
-
gem 'rails', '~> 4.2.0'
|
15
|
-
end
|
16
|
-
|
17
|
-
appraise "rails5.0" do
|
18
|
-
gem "activerecord", "~> 5.0.0"
|
19
|
-
gem "railties", "~> 5.0.0"
|
20
|
-
gem "rspec-rails", "~> 3.5.0.beta4"
|
21
|
-
end
|
data/Gemfile
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
source 'https://rubygems.org'
|
2
|
-
|
3
|
-
gemspec name: 'factory_bot_rails'
|
4
|
-
|
5
|
-
gem 'appraisal'
|
6
|
-
gem 'aruba'
|
7
|
-
gem 'coffee-rails'
|
8
|
-
gem 'cucumber', '1.3.19'
|
9
|
-
gem 'jquery-rails'
|
10
|
-
gem 'rake'
|
11
|
-
gem 'rspec-rails'
|
12
|
-
gem 'uglifier'
|
13
|
-
gem 'test-unit'
|
14
|
-
|
15
|
-
gem 'activerecord-jdbcsqlite3-adapter', platforms: :jruby
|
16
|
-
gem 'jdbc-sqlite3', platforms: :jruby
|
17
|
-
gem 'therubyrhino', platforms: :jruby
|
18
|
-
gem 'jruby-openssl', platforms: :jruby
|
19
|
-
|
20
|
-
gem 'sqlite3', platforms: :ruby
|
data/Gemfile.lock
DELETED
@@ -1,144 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
factory_bot_rails (4.10.0)
|
5
|
-
factory_bot (~> 4.10.0)
|
6
|
-
railties (>= 3.0.0)
|
7
|
-
|
8
|
-
GEM
|
9
|
-
remote: https://rubygems.org/
|
10
|
-
specs:
|
11
|
-
actionpack (4.1.1)
|
12
|
-
actionview (= 4.1.1)
|
13
|
-
activesupport (= 4.1.1)
|
14
|
-
rack (~> 1.5.2)
|
15
|
-
rack-test (~> 0.6.2)
|
16
|
-
actionview (4.1.1)
|
17
|
-
activesupport (= 4.1.1)
|
18
|
-
builder (~> 3.1)
|
19
|
-
erubis (~> 2.7.0)
|
20
|
-
activemodel (4.1.1)
|
21
|
-
activesupport (= 4.1.1)
|
22
|
-
builder (~> 3.1)
|
23
|
-
activerecord (4.1.1)
|
24
|
-
activemodel (= 4.1.1)
|
25
|
-
activesupport (= 4.1.1)
|
26
|
-
arel (~> 5.0.0)
|
27
|
-
activerecord-jdbc-adapter (1.3.15)
|
28
|
-
activerecord (>= 2.2)
|
29
|
-
activerecord-jdbcsqlite3-adapter (1.3.15)
|
30
|
-
activerecord-jdbc-adapter (~> 1.3.15)
|
31
|
-
jdbc-sqlite3 (>= 3.7.2, < 3.9)
|
32
|
-
activesupport (4.1.1)
|
33
|
-
i18n (~> 0.6, >= 0.6.9)
|
34
|
-
json (~> 1.7, >= 1.7.7)
|
35
|
-
minitest (~> 5.1)
|
36
|
-
thread_safe (~> 0.1)
|
37
|
-
tzinfo (~> 1.1)
|
38
|
-
appraisal (1.0.3)
|
39
|
-
bundler
|
40
|
-
rake
|
41
|
-
thor (>= 0.14.0)
|
42
|
-
arel (5.0.1.20140414130214)
|
43
|
-
aruba (0.5.4)
|
44
|
-
childprocess (>= 0.3.6)
|
45
|
-
cucumber (>= 1.1.1)
|
46
|
-
rspec-expectations (>= 2.7.0)
|
47
|
-
builder (3.2.2)
|
48
|
-
childprocess (0.5.3)
|
49
|
-
ffi (~> 1.0, >= 1.0.11)
|
50
|
-
coffee-rails (4.0.1)
|
51
|
-
coffee-script (>= 2.2.0)
|
52
|
-
railties (>= 4.0.0, < 5.0)
|
53
|
-
coffee-script (2.2.0)
|
54
|
-
coffee-script-source
|
55
|
-
execjs
|
56
|
-
coffee-script-source (1.7.0)
|
57
|
-
cucumber (1.3.19)
|
58
|
-
builder (>= 2.1.2)
|
59
|
-
diff-lcs (>= 1.1.3)
|
60
|
-
gherkin (~> 2.12)
|
61
|
-
multi_json (>= 1.7.5, < 2.0)
|
62
|
-
multi_test (>= 0.1.2)
|
63
|
-
diff-lcs (1.2.5)
|
64
|
-
erubis (2.7.0)
|
65
|
-
execjs (2.0.2)
|
66
|
-
factory_bot (4.10.0)
|
67
|
-
activesupport (>= 3.0.0)
|
68
|
-
ffi (1.9.3)
|
69
|
-
ffi (1.9.3-java)
|
70
|
-
gherkin (2.12.2)
|
71
|
-
multi_json (~> 1.3)
|
72
|
-
gherkin (2.12.2-java)
|
73
|
-
multi_json (~> 1.3)
|
74
|
-
i18n (0.7.0)
|
75
|
-
jdbc-sqlite3 (3.8.7)
|
76
|
-
jquery-rails (3.1.0)
|
77
|
-
railties (>= 3.0, < 5.0)
|
78
|
-
thor (>= 0.14, < 2.0)
|
79
|
-
jruby-openssl (0.9.6-java)
|
80
|
-
json (1.8.6)
|
81
|
-
json (1.8.6-java)
|
82
|
-
minitest (5.9.0)
|
83
|
-
multi_json (1.11.2)
|
84
|
-
multi_test (0.1.2)
|
85
|
-
power_assert (0.2.3)
|
86
|
-
rack (1.5.5)
|
87
|
-
rack-test (0.6.3)
|
88
|
-
rack (>= 1.0)
|
89
|
-
railties (4.1.1)
|
90
|
-
actionpack (= 4.1.1)
|
91
|
-
activesupport (= 4.1.1)
|
92
|
-
rake (>= 0.8.7)
|
93
|
-
thor (>= 0.18.1, < 2.0)
|
94
|
-
rake (11.1.2)
|
95
|
-
rspec-core (2.14.8)
|
96
|
-
rspec-expectations (2.14.5)
|
97
|
-
diff-lcs (>= 1.1.3, < 2.0)
|
98
|
-
rspec-mocks (2.14.6)
|
99
|
-
rspec-rails (2.14.2)
|
100
|
-
actionpack (>= 3.0)
|
101
|
-
activemodel (>= 3.0)
|
102
|
-
activesupport (>= 3.0)
|
103
|
-
railties (>= 3.0)
|
104
|
-
rspec-core (~> 2.14.0)
|
105
|
-
rspec-expectations (~> 2.14.0)
|
106
|
-
rspec-mocks (~> 2.14.0)
|
107
|
-
sqlite3 (1.3.9)
|
108
|
-
test-unit (3.0.9)
|
109
|
-
power_assert
|
110
|
-
therubyrhino (2.0.4)
|
111
|
-
therubyrhino_jar (>= 1.7.3)
|
112
|
-
therubyrhino_jar (1.7.4)
|
113
|
-
thor (0.19.1)
|
114
|
-
thread_safe (0.3.5)
|
115
|
-
thread_safe (0.3.5-java)
|
116
|
-
tzinfo (1.2.2)
|
117
|
-
thread_safe (~> 0.1)
|
118
|
-
uglifier (2.5.0)
|
119
|
-
execjs (>= 0.3.0)
|
120
|
-
json (>= 1.8.0)
|
121
|
-
|
122
|
-
PLATFORMS
|
123
|
-
java
|
124
|
-
ruby
|
125
|
-
|
126
|
-
DEPENDENCIES
|
127
|
-
activerecord-jdbcsqlite3-adapter
|
128
|
-
appraisal
|
129
|
-
aruba
|
130
|
-
coffee-rails
|
131
|
-
cucumber (= 1.3.19)
|
132
|
-
factory_bot_rails!
|
133
|
-
jdbc-sqlite3
|
134
|
-
jquery-rails
|
135
|
-
jruby-openssl
|
136
|
-
rake
|
137
|
-
rspec-rails
|
138
|
-
sqlite3
|
139
|
-
test-unit
|
140
|
-
therubyrhino
|
141
|
-
uglifier
|
142
|
-
|
143
|
-
BUNDLED WITH
|
144
|
-
1.16.1
|
data/Rakefile
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
require 'bundler/setup'
|
2
|
-
require 'cucumber/rake/task'
|
3
|
-
|
4
|
-
Bundler::GemHelper.install_tasks name: 'factory_bot_rails'
|
5
|
-
|
6
|
-
Cucumber::Rake::Task.new(:cucumber) do |t|
|
7
|
-
t.fork = true
|
8
|
-
t.cucumber_opts = ['--format', (ENV['CUCUMBER_FORMAT'] || 'progress')]
|
9
|
-
end
|
10
|
-
|
11
|
-
require 'appraisal'
|
12
|
-
|
13
|
-
desc 'Run the test suite'
|
14
|
-
task :default do |t|
|
15
|
-
if ENV['BUNDLE_GEMFILE'] =~ /gemfiles/
|
16
|
-
exec 'rake cucumber'
|
17
|
-
else
|
18
|
-
Rake::Task['appraise'].execute
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
task :appraise => ['appraisal:install'] do |t|
|
23
|
-
exec 'rake appraisal'
|
24
|
-
end
|
data/bin/setup
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
#!/usr/bin/env sh
|
2
|
-
|
3
|
-
# Run this script immediately after cloning the codebase.
|
4
|
-
|
5
|
-
# Exit if any subcommand fails
|
6
|
-
set -e
|
7
|
-
|
8
|
-
# Set up Ruby dependencies via Bundler
|
9
|
-
bundle install
|
10
|
-
|
11
|
-
# Add binstubs to PATH in ~/.zshenv like this:
|
12
|
-
# export PATH=".git/safe/../../bin:$PATH"
|
13
|
-
mkdir -p .git/safe
|
14
|
-
|
15
|
-
# Set up Appraisal to help us test against multiple Rails versions
|
16
|
-
bundle exec appraisal install
|
data/factory_bot_rails.gemspec
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
Gem::Specification.new do |s|
|
2
|
-
s.name = %q{factory_bot_rails}
|
3
|
-
s.version = '4.10.0'
|
4
|
-
s.authors = ["Joe Ferris"]
|
5
|
-
s.email = %q{jferris@thoughtbot.com}
|
6
|
-
s.homepage = "http://github.com/thoughtbot/factory_bot_rails"
|
7
|
-
s.summary = %q{factory_bot_rails provides integration between
|
8
|
-
factory_bot and rails 3 or newer}
|
9
|
-
s.description = %q{factory_bot_rails provides integration between
|
10
|
-
factory_bot and rails 3 or newer (currently just automatic factory definition
|
11
|
-
loading)}
|
12
|
-
|
13
|
-
s.files = Dir['**/*'].keep_if { |file| File.file?(file) }
|
14
|
-
s.require_paths = ["lib"]
|
15
|
-
s.executables = []
|
16
|
-
s.license = "MIT"
|
17
|
-
|
18
|
-
s.add_runtime_dependency('railties', '>= 3.0.0')
|
19
|
-
s.add_runtime_dependency('factory_bot', '~> 4.10.0')
|
20
|
-
end
|
data/factory_girl_rails.gemspec
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
Gem::Specification.new do |s|
|
2
|
-
s.name = %q{factory_girl_rails}
|
3
|
-
s.version = '4.8.2'
|
4
|
-
s.authors = ["Joe Ferris"]
|
5
|
-
s.email = %q{jferris@thoughtbot.com}
|
6
|
-
s.homepage = "http://github.com/thoughtbot/factory_girl_rails"
|
7
|
-
s.summary = %q{factory_girl_rails provides integration between
|
8
|
-
factory_girl and rails 3 or newer}
|
9
|
-
s.description = %q{factory_girl_rails provides integration between
|
10
|
-
factory_girl and rails 3 or newer (currently just automatic factory definition
|
11
|
-
loading)}
|
12
|
-
|
13
|
-
s.files = Dir['**/*'].keep_if { |file| File.file?(file) }
|
14
|
-
s.require_paths = ["lib"]
|
15
|
-
s.executables = []
|
16
|
-
s.license = "MIT"
|
17
|
-
|
18
|
-
s.add_runtime_dependency('railties', '>= 3.0.0')
|
19
|
-
s.add_runtime_dependency('factory_girl', '~> 4.8.2')
|
20
|
-
end
|
@@ -1,132 +0,0 @@
|
|
1
|
-
Feature:
|
2
|
-
In order to not have to manually configure Factory Bot as the Rails testing fixture replacement by using the --fixture-replacement=factory_bot option
|
3
|
-
I would like the Factory Bot Rails gem to configure Factory Bot as the fixture replacement.
|
4
|
-
|
5
|
-
Background:
|
6
|
-
Given I successfully run `bundle exec rails new testapp`
|
7
|
-
And I cd to "testapp"
|
8
|
-
And I add "factory_bot_rails" from this project as a dependency
|
9
|
-
|
10
|
-
Scenario: Using Factory Bot and Factory Bot Rails with Test Unit generates a factory file and does not generate a fixture file
|
11
|
-
And I run `bundle install` with a clean environment
|
12
|
-
And I run `bundle exec rails generate model User name:string` with a clean environment
|
13
|
-
Then the following files should exist:
|
14
|
-
| test/factories/users.rb |
|
15
|
-
And the following files should not exist:
|
16
|
-
| test/fixtures/users.yml |
|
17
|
-
|
18
|
-
Scenario: Using Factory Bot and Factory Bot Rails with RSpec should generate a factory file
|
19
|
-
When I add "rspec-rails" as a dependency
|
20
|
-
And I configure the factories as:
|
21
|
-
"""
|
22
|
-
config.generators do |g|
|
23
|
-
g.test_framework :rspec, fixture: true
|
24
|
-
g.fixture_replacement :factory_bot
|
25
|
-
end
|
26
|
-
"""
|
27
|
-
And I run `bundle install` with a clean environment
|
28
|
-
Then the output should contain "rspec-rails"
|
29
|
-
And I run `bundle exec rails generate model User name:string` with a clean environment
|
30
|
-
Then the following files should exist:
|
31
|
-
| spec/factories/users.rb |
|
32
|
-
And the following files should not exist:
|
33
|
-
| spec/fixtures/users.yml |
|
34
|
-
|
35
|
-
Scenario: Using Factory Bot and Factory Bot Rails with RSpec and suffix configuration should generate a factory file with suffix
|
36
|
-
When I add "rspec-rails" as a dependency
|
37
|
-
And I configure the factories as:
|
38
|
-
"""
|
39
|
-
config.generators do |g|
|
40
|
-
g.test_framework :rspec, fixture: true
|
41
|
-
g.fixture_replacement :factory_bot, suffix: 'factory'
|
42
|
-
end
|
43
|
-
"""
|
44
|
-
And I run `bundle install` with a clean environment
|
45
|
-
Then the output should contain "rspec-rails"
|
46
|
-
And I run `bundle exec rails generate model User name:string` with a clean environment
|
47
|
-
Then the following files should exist:
|
48
|
-
| spec/factories/users_factory.rb |
|
49
|
-
And the following files should not exist:
|
50
|
-
| spec/fixtures/users.yml |
|
51
|
-
|
52
|
-
Scenario: Using Factory Bot and Factory Bot Rails does not override a manually-configured factories directory using RSpec
|
53
|
-
When I add "rspec-rails" as a dependency
|
54
|
-
And I configure the factories directory as "custom/dir"
|
55
|
-
And I run `bundle install` with a clean environment
|
56
|
-
Then the output should contain "rspec-rails"
|
57
|
-
And I run `bundle exec rails generate model User name:string` with a clean environment
|
58
|
-
Then the following files should not exist:
|
59
|
-
| test/factories/users.rb |
|
60
|
-
| spec/factories/users.rb |
|
61
|
-
But the following files should exist:
|
62
|
-
| custom/dir/users.rb |
|
63
|
-
|
64
|
-
Scenario: Using Factory Bot and Factory Bot Rails does not override a manually-configured factories directory using Test::Unit
|
65
|
-
When I configure the factories directory as "custom/dir"
|
66
|
-
And I run `bundle install` with a clean environment
|
67
|
-
And I run `bundle exec rails generate model User name:string` with a clean environment
|
68
|
-
Then the following files should not exist:
|
69
|
-
| test/factories/users.rb |
|
70
|
-
| spec/factories/users.rb |
|
71
|
-
But the following files should exist:
|
72
|
-
| custom/dir/users.rb |
|
73
|
-
|
74
|
-
Scenario: Using Factory Bot Rails with MiniTest should generate a factory file
|
75
|
-
When I run `bundle install` with a clean environment
|
76
|
-
And I run `bundle exec rails generate model User name:string` with a clean environment
|
77
|
-
Then the following files should exist:
|
78
|
-
| test/factories/users.rb |
|
79
|
-
But the following files should not exist:
|
80
|
-
| spec/fixtures/users.yml |
|
81
|
-
|
82
|
-
Scenario: Using Factory Bot Rails with MiniTest and a custom directory should generate a factory file
|
83
|
-
When I configure the factories directory as "custom/dir"
|
84
|
-
And I run `bundle install` with a clean environment
|
85
|
-
And I run `bundle exec rails generate model User name:string` with a clean environment
|
86
|
-
Then the following files should exist:
|
87
|
-
| custom/dir/users.rb |
|
88
|
-
But the following files should not exist:
|
89
|
-
| spec/fixtures/users.yml |
|
90
|
-
|
91
|
-
Scenario: Disable Factory Bot generator
|
92
|
-
When I configure the factories as:
|
93
|
-
"""
|
94
|
-
config.generators do |g|
|
95
|
-
g.factory_bot false
|
96
|
-
end
|
97
|
-
"""
|
98
|
-
And I run `bundle install` with a clean environment
|
99
|
-
And I run `bundle exec rails generate model User name:string` with a clean environment
|
100
|
-
Then the following files should not exist:
|
101
|
-
| test/factories/users.rb |
|
102
|
-
| spec/factories/users.rb |
|
103
|
-
|
104
|
-
Scenario: Use a suffix with the Factory Bot generator
|
105
|
-
When I add "rspec-rails" as a dependency
|
106
|
-
When I configure the factories as:
|
107
|
-
"""
|
108
|
-
config.generators do |g|
|
109
|
-
g.factory_bot suffix: 'suffix'
|
110
|
-
end
|
111
|
-
"""
|
112
|
-
And I run `bundle install` with a clean environment
|
113
|
-
And I run `bundle exec rails generate model User name:string` with a clean environment
|
114
|
-
Then the following files should exist:
|
115
|
-
| spec/factories/users_suffix.rb |
|
116
|
-
Then the following files should not exist:
|
117
|
-
| spec/factories/users.rb |
|
118
|
-
|
119
|
-
Scenario: Use a filename_proc with the Factory Bot generator
|
120
|
-
When I add "rspec-rails" as a dependency
|
121
|
-
When I configure the factories as:
|
122
|
-
"""
|
123
|
-
config.generators do |g|
|
124
|
-
g.factory_bot filename_proc: Proc.new { |tb| "prefix_#{tb.singularize}_suffix" }
|
125
|
-
end
|
126
|
-
"""
|
127
|
-
And I run `bundle install` with a clean environment
|
128
|
-
And I run `bundle exec rails generate model User name:string` with a clean environment
|
129
|
-
Then the following files should exist:
|
130
|
-
| spec/factories/prefix_user_suffix.rb |
|
131
|
-
Then the following files should not exist:
|
132
|
-
| spec/factories/users.rb |
|