factory_girl_rails 4.2.0 → 4.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Appraisals +3 -3
- data/factory_girl_rails.gemspec +1 -1
- data/features/fixture_replacement_config.feature +7 -0
- data/features/step_definitions/rails_steps.rb +8 -0
- data/gemfiles/rails3.0.gemfile +1 -1
- data/gemfiles/rails3.0.gemfile.lock +30 -30
- data/gemfiles/rails3.1.gemfile +1 -1
- data/gemfiles/rails3.1.gemfile.lock +31 -31
- data/gemfiles/rails3.2.gemfile +1 -1
- data/gemfiles/rails3.2.gemfile.lock +32 -32
- data/lib/factory_girl_rails/railtie.rb +9 -5
- data/lib/generators/factory_girl/model/model_generator.rb +1 -0
- metadata +3 -2
data/Appraisals
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
appraise "rails3.0" do
|
2
|
-
gem "rails", "3.0.
|
2
|
+
gem "rails", "3.0.20"
|
3
3
|
gem "sqlite3", ">= 1.3.4", platforms: :mri
|
4
4
|
gem "activerecord-jdbcsqlite3-adapter", "~> 1.2.5", platforms: :jruby
|
5
5
|
gem "minitest-rails"
|
@@ -9,7 +9,7 @@ appraise "rails3.0" do
|
|
9
9
|
end
|
10
10
|
|
11
11
|
appraise "rails3.1" do
|
12
|
-
gem "rails", "3.1.
|
12
|
+
gem "rails", "3.1.10"
|
13
13
|
gem "sass-rails"
|
14
14
|
gem "coffee-rails"
|
15
15
|
gem "uglifier"
|
@@ -22,7 +22,7 @@ appraise "rails3.1" do
|
|
22
22
|
end
|
23
23
|
|
24
24
|
appraise "rails3.2" do
|
25
|
-
gem "rails", "3.2.
|
25
|
+
gem "rails", "3.2.11"
|
26
26
|
gem "sass-rails"
|
27
27
|
gem "coffee-rails"
|
28
28
|
gem "uglifier"
|
data/factory_girl_rails.gemspec
CHANGED
@@ -17,6 +17,13 @@ Feature:
|
|
17
17
|
|
18
18
|
Scenario: Using Factory Girl and Factory Girl Rails with RSpec should generate a factory file
|
19
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_girl
|
25
|
+
end
|
26
|
+
"""
|
20
27
|
And I run `bundle install` with a clean environment
|
21
28
|
Then the output should contain "rspec-rails"
|
22
29
|
And I run `bundle exec rails generate model User name:string` with a clean environment
|
@@ -19,6 +19,14 @@ When /^I set the FactoryGirl :suffix option to "([^"]+)"$/ do |suffix|
|
|
19
19
|
|
20
20
|
end
|
21
21
|
|
22
|
+
When /^I configure the factories as:$/ do |string|
|
23
|
+
append_to_file File.join('config', 'application.rb'), <<-END
|
24
|
+
class Testapp::Application
|
25
|
+
#{string}
|
26
|
+
end
|
27
|
+
END
|
28
|
+
end
|
29
|
+
|
22
30
|
When /^I configure the factories directory as "([^"]+)"$/ do |factory_dir|
|
23
31
|
append_to_file File.join('config', 'application.rb'), <<-END
|
24
32
|
class Testapp::Application
|
data/gemfiles/rails3.0.gemfile
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: /Users/joshuaclayton/dev/gems/factory_girl_rails
|
3
3
|
specs:
|
4
|
-
factory_girl_rails (4.2.
|
4
|
+
factory_girl_rails (4.2.1)
|
5
5
|
factory_girl (~> 4.2.0)
|
6
6
|
railties (>= 3.0.0)
|
7
7
|
|
@@ -9,12 +9,12 @@ GEM
|
|
9
9
|
remote: http://rubygems.org/
|
10
10
|
specs:
|
11
11
|
abstract (1.0.0)
|
12
|
-
actionmailer (3.0.
|
13
|
-
actionpack (= 3.0.
|
12
|
+
actionmailer (3.0.20)
|
13
|
+
actionpack (= 3.0.20)
|
14
14
|
mail (~> 2.2.19)
|
15
|
-
actionpack (3.0.
|
16
|
-
activemodel (= 3.0.
|
17
|
-
activesupport (= 3.0.
|
15
|
+
actionpack (3.0.20)
|
16
|
+
activemodel (= 3.0.20)
|
17
|
+
activesupport (= 3.0.20)
|
18
18
|
builder (~> 2.1.2)
|
19
19
|
erubis (~> 2.6.6)
|
20
20
|
i18n (~> 0.5.0)
|
@@ -22,19 +22,19 @@ GEM
|
|
22
22
|
rack-mount (~> 0.6.14)
|
23
23
|
rack-test (~> 0.5.7)
|
24
24
|
tzinfo (~> 0.3.23)
|
25
|
-
activemodel (3.0.
|
26
|
-
activesupport (= 3.0.
|
25
|
+
activemodel (3.0.20)
|
26
|
+
activesupport (= 3.0.20)
|
27
27
|
builder (~> 2.1.2)
|
28
28
|
i18n (~> 0.5.0)
|
29
|
-
activerecord (3.0.
|
30
|
-
activemodel (= 3.0.
|
31
|
-
activesupport (= 3.0.
|
29
|
+
activerecord (3.0.20)
|
30
|
+
activemodel (= 3.0.20)
|
31
|
+
activesupport (= 3.0.20)
|
32
32
|
arel (~> 2.0.10)
|
33
33
|
tzinfo (~> 0.3.23)
|
34
|
-
activeresource (3.0.
|
35
|
-
activemodel (= 3.0.
|
36
|
-
activesupport (= 3.0.
|
37
|
-
activesupport (3.0.
|
34
|
+
activeresource (3.0.20)
|
35
|
+
activemodel (= 3.0.20)
|
36
|
+
activesupport (= 3.0.20)
|
37
|
+
activesupport (3.0.20)
|
38
38
|
appraisal (0.5.1)
|
39
39
|
bundler
|
40
40
|
rake
|
@@ -44,7 +44,7 @@ GEM
|
|
44
44
|
cucumber (>= 1.1.1)
|
45
45
|
rspec-expectations (>= 2.7.0)
|
46
46
|
builder (2.1.2)
|
47
|
-
childprocess (0.3.
|
47
|
+
childprocess (0.3.7)
|
48
48
|
ffi (~> 1.0, >= 1.0.6)
|
49
49
|
cucumber (1.2.1)
|
50
50
|
builder (>= 2.1.2)
|
@@ -57,10 +57,10 @@ GEM
|
|
57
57
|
factory_girl (4.2.0)
|
58
58
|
activesupport (>= 3.0.0)
|
59
59
|
ffi (1.3.1)
|
60
|
-
gherkin (2.11.
|
61
|
-
json (>= 1.
|
60
|
+
gherkin (2.11.6)
|
61
|
+
json (>= 1.7.6)
|
62
62
|
i18n (0.5.0)
|
63
|
-
jquery-rails (2.
|
63
|
+
jquery-rails (2.2.0)
|
64
64
|
railties (>= 3.0, < 5.0)
|
65
65
|
thor (>= 0.14, < 2.0)
|
66
66
|
json (1.7.6)
|
@@ -80,17 +80,17 @@ GEM
|
|
80
80
|
rack (>= 1.0.0)
|
81
81
|
rack-test (0.5.7)
|
82
82
|
rack (>= 1.0)
|
83
|
-
rails (3.0.
|
84
|
-
actionmailer (= 3.0.
|
85
|
-
actionpack (= 3.0.
|
86
|
-
activerecord (= 3.0.
|
87
|
-
activeresource (= 3.0.
|
88
|
-
activesupport (= 3.0.
|
83
|
+
rails (3.0.20)
|
84
|
+
actionmailer (= 3.0.20)
|
85
|
+
actionpack (= 3.0.20)
|
86
|
+
activerecord (= 3.0.20)
|
87
|
+
activeresource (= 3.0.20)
|
88
|
+
activesupport (= 3.0.20)
|
89
89
|
bundler (~> 1.0)
|
90
|
-
railties (= 3.0.
|
91
|
-
railties (3.0.
|
92
|
-
actionpack (= 3.0.
|
93
|
-
activesupport (= 3.0.
|
90
|
+
railties (= 3.0.20)
|
91
|
+
railties (3.0.20)
|
92
|
+
actionpack (= 3.0.20)
|
93
|
+
activesupport (= 3.0.20)
|
94
94
|
rake (>= 0.8.7)
|
95
95
|
rdoc (~> 3.4)
|
96
96
|
thor (~> 0.14.4)
|
@@ -131,7 +131,7 @@ DEPENDENCIES
|
|
131
131
|
factory_girl_rails!
|
132
132
|
jquery-rails
|
133
133
|
minitest-rails
|
134
|
-
rails (= 3.0.
|
134
|
+
rails (= 3.0.20)
|
135
135
|
rake
|
136
136
|
rspec (~> 2.11.0)
|
137
137
|
rspec-rails
|
data/gemfiles/rails3.1.gemfile
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
PATH
|
2
2
|
remote: /Users/joshuaclayton/dev/gems/factory_girl_rails
|
3
3
|
specs:
|
4
|
-
factory_girl_rails (4.2.
|
4
|
+
factory_girl_rails (4.2.1)
|
5
5
|
factory_girl (~> 4.2.0)
|
6
6
|
railties (>= 3.0.0)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: http://rubygems.org/
|
10
10
|
specs:
|
11
|
-
actionmailer (3.1.
|
12
|
-
actionpack (= 3.1.
|
11
|
+
actionmailer (3.1.10)
|
12
|
+
actionpack (= 3.1.10)
|
13
13
|
mail (~> 2.3.3)
|
14
|
-
actionpack (3.1.
|
15
|
-
activemodel (= 3.1.
|
16
|
-
activesupport (= 3.1.
|
14
|
+
actionpack (3.1.10)
|
15
|
+
activemodel (= 3.1.10)
|
16
|
+
activesupport (= 3.1.10)
|
17
17
|
builder (~> 3.0.0)
|
18
18
|
erubis (~> 2.7.0)
|
19
19
|
i18n (~> 0.6)
|
@@ -22,19 +22,19 @@ GEM
|
|
22
22
|
rack-mount (~> 0.8.2)
|
23
23
|
rack-test (~> 0.6.1)
|
24
24
|
sprockets (~> 2.0.4)
|
25
|
-
activemodel (3.1.
|
26
|
-
activesupport (= 3.1.
|
25
|
+
activemodel (3.1.10)
|
26
|
+
activesupport (= 3.1.10)
|
27
27
|
builder (~> 3.0.0)
|
28
28
|
i18n (~> 0.6)
|
29
|
-
activerecord (3.1.
|
30
|
-
activemodel (= 3.1.
|
31
|
-
activesupport (= 3.1.
|
29
|
+
activerecord (3.1.10)
|
30
|
+
activemodel (= 3.1.10)
|
31
|
+
activesupport (= 3.1.10)
|
32
32
|
arel (~> 2.2.3)
|
33
33
|
tzinfo (~> 0.3.29)
|
34
|
-
activeresource (3.1.
|
35
|
-
activemodel (= 3.1.
|
36
|
-
activesupport (= 3.1.
|
37
|
-
activesupport (3.1.
|
34
|
+
activeresource (3.1.10)
|
35
|
+
activemodel (= 3.1.10)
|
36
|
+
activesupport (= 3.1.10)
|
37
|
+
activesupport (3.1.10)
|
38
38
|
multi_json (>= 1.0, < 1.3)
|
39
39
|
appraisal (0.5.1)
|
40
40
|
bundler
|
@@ -45,7 +45,7 @@ GEM
|
|
45
45
|
cucumber (>= 1.1.1)
|
46
46
|
rspec-expectations (>= 2.7.0)
|
47
47
|
builder (3.0.4)
|
48
|
-
childprocess (0.3.
|
48
|
+
childprocess (0.3.7)
|
49
49
|
ffi (~> 1.0, >= 1.0.6)
|
50
50
|
coffee-rails (3.1.1)
|
51
51
|
coffee-script (>= 2.2.0)
|
@@ -66,11 +66,11 @@ GEM
|
|
66
66
|
factory_girl (4.2.0)
|
67
67
|
activesupport (>= 3.0.0)
|
68
68
|
ffi (1.3.1)
|
69
|
-
gherkin (2.11.
|
70
|
-
json (>= 1.
|
69
|
+
gherkin (2.11.6)
|
70
|
+
json (>= 1.7.6)
|
71
71
|
hike (1.2.1)
|
72
72
|
i18n (0.6.1)
|
73
|
-
jquery-rails (2.
|
73
|
+
jquery-rails (2.2.0)
|
74
74
|
railties (>= 3.0, < 5.0)
|
75
75
|
thor (>= 0.14, < 2.0)
|
76
76
|
json (1.7.6)
|
@@ -90,21 +90,21 @@ GEM
|
|
90
90
|
rack (>= 0.4)
|
91
91
|
rack-mount (0.8.3)
|
92
92
|
rack (>= 1.0.0)
|
93
|
-
rack-ssl (1.3.
|
93
|
+
rack-ssl (1.3.3)
|
94
94
|
rack
|
95
95
|
rack-test (0.6.2)
|
96
96
|
rack (>= 1.0)
|
97
|
-
rails (3.1.
|
98
|
-
actionmailer (= 3.1.
|
99
|
-
actionpack (= 3.1.
|
100
|
-
activerecord (= 3.1.
|
101
|
-
activeresource (= 3.1.
|
102
|
-
activesupport (= 3.1.
|
97
|
+
rails (3.1.10)
|
98
|
+
actionmailer (= 3.1.10)
|
99
|
+
actionpack (= 3.1.10)
|
100
|
+
activerecord (= 3.1.10)
|
101
|
+
activeresource (= 3.1.10)
|
102
|
+
activesupport (= 3.1.10)
|
103
103
|
bundler (~> 1.0)
|
104
|
-
railties (= 3.1.
|
105
|
-
railties (3.1.
|
106
|
-
actionpack (= 3.1.
|
107
|
-
activesupport (= 3.1.
|
104
|
+
railties (= 3.1.10)
|
105
|
+
railties (3.1.10)
|
106
|
+
actionpack (= 3.1.10)
|
107
|
+
activesupport (= 3.1.10)
|
108
108
|
rack-ssl (~> 1.3.2)
|
109
109
|
rake (>= 0.8.7)
|
110
110
|
rdoc (~> 3.4)
|
@@ -161,7 +161,7 @@ DEPENDENCIES
|
|
161
161
|
factory_girl_rails!
|
162
162
|
jquery-rails
|
163
163
|
minitest-rails
|
164
|
-
rails (= 3.1.
|
164
|
+
rails (= 3.1.10)
|
165
165
|
rake
|
166
166
|
rspec (~> 2.11.0)
|
167
167
|
rspec-rails
|
data/gemfiles/rails3.2.gemfile
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
PATH
|
2
2
|
remote: /Users/joshuaclayton/dev/gems/factory_girl_rails
|
3
3
|
specs:
|
4
|
-
factory_girl_rails (4.2.
|
4
|
+
factory_girl_rails (4.2.1)
|
5
5
|
factory_girl (~> 4.2.0)
|
6
6
|
railties (>= 3.0.0)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: http://rubygems.org/
|
10
10
|
specs:
|
11
|
-
actionmailer (3.2.
|
12
|
-
actionpack (= 3.2.
|
11
|
+
actionmailer (3.2.11)
|
12
|
+
actionpack (= 3.2.11)
|
13
13
|
mail (~> 2.4.4)
|
14
|
-
actionpack (3.2.
|
15
|
-
activemodel (= 3.2.
|
16
|
-
activesupport (= 3.2.
|
14
|
+
actionpack (3.2.11)
|
15
|
+
activemodel (= 3.2.11)
|
16
|
+
activesupport (= 3.2.11)
|
17
17
|
builder (~> 3.0.0)
|
18
18
|
erubis (~> 2.7.0)
|
19
19
|
journey (~> 1.0.4)
|
@@ -21,18 +21,18 @@ GEM
|
|
21
21
|
rack-cache (~> 1.2)
|
22
22
|
rack-test (~> 0.6.1)
|
23
23
|
sprockets (~> 2.2.1)
|
24
|
-
activemodel (3.2.
|
25
|
-
activesupport (= 3.2.
|
24
|
+
activemodel (3.2.11)
|
25
|
+
activesupport (= 3.2.11)
|
26
26
|
builder (~> 3.0.0)
|
27
|
-
activerecord (3.2.
|
28
|
-
activemodel (= 3.2.
|
29
|
-
activesupport (= 3.2.
|
27
|
+
activerecord (3.2.11)
|
28
|
+
activemodel (= 3.2.11)
|
29
|
+
activesupport (= 3.2.11)
|
30
30
|
arel (~> 3.0.2)
|
31
31
|
tzinfo (~> 0.3.29)
|
32
|
-
activeresource (3.2.
|
33
|
-
activemodel (= 3.2.
|
34
|
-
activesupport (= 3.2.
|
35
|
-
activesupport (3.2.
|
32
|
+
activeresource (3.2.11)
|
33
|
+
activemodel (= 3.2.11)
|
34
|
+
activesupport (= 3.2.11)
|
35
|
+
activesupport (3.2.11)
|
36
36
|
i18n (~> 0.6)
|
37
37
|
multi_json (~> 1.0)
|
38
38
|
appraisal (0.5.1)
|
@@ -44,7 +44,7 @@ GEM
|
|
44
44
|
cucumber (>= 1.1.1)
|
45
45
|
rspec-expectations (>= 2.7.0)
|
46
46
|
builder (3.0.4)
|
47
|
-
childprocess (0.3.
|
47
|
+
childprocess (0.3.7)
|
48
48
|
ffi (~> 1.0, >= 1.0.6)
|
49
49
|
coffee-rails (3.2.2)
|
50
50
|
coffee-script (>= 2.2.0)
|
@@ -65,12 +65,12 @@ GEM
|
|
65
65
|
factory_girl (4.2.0)
|
66
66
|
activesupport (>= 3.0.0)
|
67
67
|
ffi (1.3.1)
|
68
|
-
gherkin (2.11.
|
69
|
-
json (>= 1.
|
68
|
+
gherkin (2.11.6)
|
69
|
+
json (>= 1.7.6)
|
70
70
|
hike (1.2.1)
|
71
71
|
i18n (0.6.1)
|
72
72
|
journey (1.0.4)
|
73
|
-
jquery-rails (2.
|
73
|
+
jquery-rails (2.2.0)
|
74
74
|
railties (>= 3.0, < 5.0)
|
75
75
|
thor (>= 0.14, < 2.0)
|
76
76
|
json (1.7.6)
|
@@ -88,21 +88,21 @@ GEM
|
|
88
88
|
rack (1.4.4)
|
89
89
|
rack-cache (1.2)
|
90
90
|
rack (>= 0.4)
|
91
|
-
rack-ssl (1.3.
|
91
|
+
rack-ssl (1.3.3)
|
92
92
|
rack
|
93
93
|
rack-test (0.6.2)
|
94
94
|
rack (>= 1.0)
|
95
|
-
rails (3.2.
|
96
|
-
actionmailer (= 3.2.
|
97
|
-
actionpack (= 3.2.
|
98
|
-
activerecord (= 3.2.
|
99
|
-
activeresource (= 3.2.
|
100
|
-
activesupport (= 3.2.
|
95
|
+
rails (3.2.11)
|
96
|
+
actionmailer (= 3.2.11)
|
97
|
+
actionpack (= 3.2.11)
|
98
|
+
activerecord (= 3.2.11)
|
99
|
+
activeresource (= 3.2.11)
|
100
|
+
activesupport (= 3.2.11)
|
101
101
|
bundler (~> 1.0)
|
102
|
-
railties (= 3.2.
|
103
|
-
railties (3.2.
|
104
|
-
actionpack (= 3.2.
|
105
|
-
activesupport (= 3.2.
|
102
|
+
railties (= 3.2.11)
|
103
|
+
railties (3.2.11)
|
104
|
+
actionpack (= 3.2.11)
|
105
|
+
activesupport (= 3.2.11)
|
106
106
|
rack-ssl (~> 1.3.2)
|
107
107
|
rake (>= 0.8.7)
|
108
108
|
rdoc (~> 3.4)
|
@@ -137,7 +137,7 @@ GEM
|
|
137
137
|
therubyrhino (2.0.2)
|
138
138
|
therubyrhino_jar (>= 1.7.3)
|
139
139
|
therubyrhino_jar (1.7.4)
|
140
|
-
thor (0.
|
140
|
+
thor (0.17.0)
|
141
141
|
tilt (1.3.3)
|
142
142
|
treetop (1.4.12)
|
143
143
|
polyglot
|
@@ -159,7 +159,7 @@ DEPENDENCIES
|
|
159
159
|
factory_girl_rails!
|
160
160
|
jquery-rails
|
161
161
|
minitest-rails
|
162
|
-
rails (= 3.2.
|
162
|
+
rails (= 3.2.11)
|
163
163
|
rake
|
164
164
|
rspec (~> 2.11.0)
|
165
165
|
rspec-rails
|
@@ -9,8 +9,12 @@ module FactoryGirl
|
|
9
9
|
rails_options = generators.options[:rails]
|
10
10
|
|
11
11
|
if rails_options[:test_framework] == :rspec
|
12
|
-
|
13
|
-
|
12
|
+
factory_girl_dir = generators.options.fetch(:factory_girl, { :dir => 'spec/factories' })[:dir]
|
13
|
+
|
14
|
+
if rails_options.has_key?(:fixture_replacement)
|
15
|
+
generators.fixture_replacement rails_options[:fixture_replacement], :dir => factory_girl_dir
|
16
|
+
else
|
17
|
+
generators.fixture_replacement :factory_girl, :dir => factory_girl_dir
|
14
18
|
end
|
15
19
|
else
|
16
20
|
generators.test_framework rails_options[:test_framework], :fixture => false, :fixture_replacement => :factory_girl
|
@@ -19,9 +23,9 @@ module FactoryGirl
|
|
19
23
|
|
20
24
|
initializer "factory_girl.set_factory_paths" do
|
21
25
|
FactoryGirl.definition_file_paths = [
|
22
|
-
|
23
|
-
|
24
|
-
|
26
|
+
Rails.root.join('factories'),
|
27
|
+
Rails.root.join('test', 'factories'),
|
28
|
+
Rails.root.join('spec', 'factories')
|
25
29
|
]
|
26
30
|
end
|
27
31
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: factory_girl_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.2.
|
4
|
+
version: 4.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-02-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: railties
|
@@ -194,3 +194,4 @@ test_files:
|
|
194
194
|
- gemfiles/rails3.1.gemfile.lock
|
195
195
|
- gemfiles/rails3.2.gemfile
|
196
196
|
- gemfiles/rails3.2.gemfile.lock
|
197
|
+
has_rdoc:
|