pickle 0.5.2 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.github/workflows/build.yml +62 -0
- data/.gitignore +3 -2
- data/.travis.yml +24 -4
- data/History.txt +52 -35
- data/README.md +19 -27
- data/Rakefile.d/cucumber.rake +13 -4
- data/Rakefile.d/repoclean.rake +3 -0
- data/features/app/app.rb +7 -7
- data/features/app/factories.rb +5 -5
- data/features/email/email.feature +1 -0
- data/features/step_definitions/email_steps.rb +1 -0
- data/features/step_definitions/extra_email_steps.rb +5 -5
- data/features/step_definitions/pickle_steps.rb +1 -0
- data/features/support/email.rb +1 -0
- data/features/support/env.rb +9 -3
- data/features/support/pickle.rb +2 -2
- data/gemfiles/Gemfile-rails.4.2.x +13 -0
- data/gemfiles/Gemfile-rails.5.0.x +12 -0
- data/gemfiles/Gemfile-rails.5.1.x +10 -0
- data/gemfiles/Gemfile-rails.5.2.x +11 -0
- data/gemfiles/Gemfile-rails.5.2.x-cukes-4 +11 -0
- data/gemfiles/Gemfile-rails.5.2.x-cukes-5 +11 -0
- data/gemfiles/Gemfile-rails.6.0.x-cukes-3 +10 -0
- data/gemfiles/Gemfile-rails.6.0.x-cukes-4 +10 -0
- data/gemfiles/Gemfile-rails.6.0.x-cukes-5 +11 -0
- data/gemfiles/Gemfile-rails.6.0.x-cukes-6 +11 -0
- data/gemfiles/Gemfile-rails.6.1.x-cukes-3 +10 -0
- data/gemfiles/Gemfile-rails.6.1.x-cukes-4 +10 -0
- data/gemfiles/Gemfile-rails.6.1.x-cukes-5 +11 -0
- data/gemfiles/Gemfile-rails.6.1.x-cukes-6 +11 -0
- data/gemfiles/Gemfile-rails.edge +9 -0
- data/lib/pickle.rb +0 -1
- data/lib/pickle/adapter.rb +9 -11
- data/lib/pickle/config.rb +1 -1
- data/lib/pickle/path.rb +1 -1
- data/lib/pickle/version.rb +1 -1
- data/pickle.gemspec +10 -9
- data/rails_generators/pickle/templates/pickle.rb +2 -2
- data/spec/pickle/adapter_spec.rb +19 -19
- data/spec/pickle/config_spec.rb +9 -9
- data/spec/pickle/email_spec.rb +1 -1
- data/spec/pickle/path_spec.rb +37 -18
- data/spec/pickle/session_spec.rb +5 -5
- data/spec/spec_helper.rb +6 -1
- metadata +62 -56
- data/Gemfile +0 -3
- data/Gemfile.lock.development +0 -158
- data/features/step_definitions/email_steps.rb +0 -65
- data/features/step_definitions/pickle_steps.rb +0 -105
- data/features/support/email.rb +0 -21
- data/init.rb +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f34526ae76a0b88ab46f94922f171eeedf1e981b8ee66fc578ceb8f4cb72f77b
|
4
|
+
data.tar.gz: c6a954b1a1c00a03257456997ff35c1de7e906c549e19cb1e0d8a58159acde1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e088d8bd67ccda647a98b841dd26db5c542bdb434e377d6f73e6c9c982f59b35a1adb5ea82f22623faeff1c62cdff6c752fa07f6df7e87cac921d5eca74c8975
|
7
|
+
data.tar.gz: 8241e6550e58e7260b7c640524ff504d23db306558633f52c2c9d38dcfb2636dcc9ec7faa4471dcfc19849659cc63d0a3af34490f2a1cfe1654d4fde48932f8f
|
@@ -0,0 +1,62 @@
|
|
1
|
+
# This workflow uses actions that are not certified by GitHub.
|
2
|
+
# They are provided by a third-party and are governed by
|
3
|
+
# separate terms of service, privacy policy, and support
|
4
|
+
# documentation.
|
5
|
+
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
|
6
|
+
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
|
7
|
+
|
8
|
+
name: build
|
9
|
+
|
10
|
+
on: [push, pull_request]
|
11
|
+
|
12
|
+
jobs:
|
13
|
+
test:
|
14
|
+
runs-on: ubuntu-20.04
|
15
|
+
strategy:
|
16
|
+
fail-fast: false
|
17
|
+
matrix:
|
18
|
+
ruby:
|
19
|
+
- 3.0
|
20
|
+
- 2.7
|
21
|
+
- 2.6
|
22
|
+
- 2.5
|
23
|
+
gemfile:
|
24
|
+
# Cucumber 3.2+
|
25
|
+
- Gemfile-rails.4.2.x
|
26
|
+
- Gemfile-rails.5.0.x
|
27
|
+
- Gemfile-rails.5.1.x
|
28
|
+
- Gemfile-rails.5.2.x
|
29
|
+
- Gemfile-rails.6.0.x-cukes-3
|
30
|
+
- Gemfile-rails.6.1.x-cukes-3
|
31
|
+
# Cucumber 4.1+
|
32
|
+
- Gemfile-rails.5.2.x-cukes-4
|
33
|
+
- Gemfile-rails.6.0.x-cukes-4
|
34
|
+
# Cucumber 5.3+
|
35
|
+
- Gemfile-rails.5.2.x-cukes-5
|
36
|
+
- Gemfile-rails.6.0.x-cukes-5
|
37
|
+
- Gemfile-rails.6.1.x-cukes-5
|
38
|
+
# Cucumber 6
|
39
|
+
- Gemfile-rails.6.0.x-cukes-6
|
40
|
+
- Gemfile-rails.6.1.x-cukes-6
|
41
|
+
# Edge
|
42
|
+
- Gemfile-rails.edge
|
43
|
+
exclude:
|
44
|
+
# Rails edge is now 7.x and requires ruby 2.7
|
45
|
+
- gemfile: Gemfile-rails.edge
|
46
|
+
ruby: 2.6
|
47
|
+
- gemfile: Gemfile-rails.edge
|
48
|
+
ruby: 2.5
|
49
|
+
- gemfile: Gemfile-rails.4.2.x
|
50
|
+
ruby: 2.7
|
51
|
+
- gemfile: Gemfile-rails.4.2.x
|
52
|
+
ruby: 3.0
|
53
|
+
|
54
|
+
env:
|
55
|
+
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}
|
56
|
+
steps:
|
57
|
+
- uses: actions/checkout@v2
|
58
|
+
- uses: ruby/setup-ruby@v1
|
59
|
+
with:
|
60
|
+
ruby-version: ${{ matrix.ruby }}
|
61
|
+
bundler-cache: true
|
62
|
+
- run: bundle exec rake
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -1,10 +1,30 @@
|
|
1
1
|
language: ruby
|
2
|
+
dist: xenial
|
3
|
+
cache: bundler
|
2
4
|
rvm:
|
3
|
-
|
4
|
-
- 2.
|
5
|
+
#- 2.7.1
|
6
|
+
- 2.6.6
|
7
|
+
- 2.5.8
|
8
|
+
#- ruby-head
|
9
|
+
gemfile:
|
10
|
+
- gemfiles/Gemfile-rails.5.0.x
|
11
|
+
- gemfiles/Gemfile-rails.5.1.x
|
12
|
+
- gemfiles/Gemfile-rails.5.2.x
|
13
|
+
- gemfiles/Gemfile-rails.5.2.x-cukes-4
|
14
|
+
- gemfiles/Gemfile-rails.5.2.x-cukes-5
|
15
|
+
- gemfiles/Gemfile-rails.6.0.x
|
16
|
+
- gemfiles/Gemfile-rails.6.0.x-cukes-5
|
17
|
+
#- gemfiles/Gemfile-rails.edge
|
18
|
+
matrix:
|
19
|
+
allow_failures:
|
20
|
+
- rvm: ruby-head
|
21
|
+
- rvm: 2.7.1
|
22
|
+
- gemfile: gemfiles/Gemfile-rails.edge
|
23
|
+
- gemfile: gemfiles/Gemfile-rails.5.2.x-cukes-5
|
24
|
+
- gemfile: gemfiles/Gemfile-rails.6.0.x-cukes-5
|
25
|
+
fast_finish: true
|
5
26
|
|
6
|
-
before_install:
|
7
|
-
- cp Gemfile.lock.development Gemfile.lock
|
8
27
|
script:
|
28
|
+
- gem install bundler
|
9
29
|
- bundle exec rake spec
|
10
30
|
- bundle exec rake cucumber
|
data/History.txt
CHANGED
@@ -1,5 +1,22 @@
|
|
1
|
+
== 0.6.0
|
2
|
+
* Drop support for cucumber < 3
|
3
|
+
* Officially support cucumber 4.1
|
4
|
+
* Relax dependency to support cucumber 5.x although not officially supported
|
5
|
+
* Run tests for Rails 5.0, 5.1, 5.2 and 6.0
|
6
|
+
|
7
|
+
== 0.5.5
|
8
|
+
* Relax dependency on cucumber to allow usage with Rails 5.2 [Yohei Kitamura]
|
9
|
+
|
10
|
+
== 0.5.4
|
11
|
+
* updated FactoryGirl to FactoryBot [Blake McDaniel]
|
12
|
+
|
13
|
+
== 0.5.3
|
14
|
+
* small fix to pickle_path_for_resources_action_segment [Tema Bolshakov]
|
15
|
+
* update for fabrication adapter with protected method klass [Liam Krewer]
|
16
|
+
* Fix tests to run on travis again and codecoverage [Mathieu Jobin]
|
17
|
+
|
1
18
|
== 0.5.2
|
2
|
-
* replace alias_method_chain by Module#prepend
|
19
|
+
* replace alias_method_chain by Module#prepend [Mathieu Jobin]
|
3
20
|
eliminating deprecation warnings when using with Rails 5
|
4
21
|
|
5
22
|
== 0.5.1
|
@@ -33,7 +50,7 @@
|
|
33
50
|
|
34
51
|
* 1 bugfix
|
35
52
|
* Don't blow up when fabrication not present [Ian White]
|
36
|
-
|
53
|
+
|
37
54
|
|
38
55
|
== 0.4.9
|
39
56
|
|
@@ -42,8 +59,8 @@
|
|
42
59
|
|
43
60
|
* 1 minor improvement
|
44
61
|
* Update development dependencies so tests/features run on rails 3.1 and friends
|
45
|
-
|
46
|
-
|
62
|
+
|
63
|
+
|
47
64
|
== 0.4.8
|
48
65
|
|
49
66
|
* 2 minor improvements
|
@@ -56,7 +73,7 @@
|
|
56
73
|
* 2 minor improvements
|
57
74
|
* Better error message for failing to find a model [Ian White, reported by Yuval Karmi]
|
58
75
|
* dev deps updated to latest cucumber & cucumber-rails [Ian White]
|
59
|
-
|
76
|
+
|
60
77
|
|
61
78
|
== 0.4.6
|
62
79
|
Documentation updates
|
@@ -79,7 +96,7 @@ large object space fix, and allow escaped quotes as string values
|
|
79
96
|
* 1 bugfix
|
80
97
|
* When using super-huge GC limits (for speeding up tests), occasionally we'll see abandoned Mongoid::Document classes appear in the ObjectSpace.
|
81
98
|
This patch should fix that. [Devin Walters and Nick Karpenske]
|
82
|
-
|
99
|
+
|
83
100
|
* 1 improvement
|
84
101
|
* allow escaped quotes (\") in quoted fields [Jonathan Hinkle]
|
85
102
|
|
@@ -103,7 +120,7 @@ Docfix
|
|
103
120
|
|
104
121
|
* 1 improvement
|
105
122
|
* documentation fixes, and example of writing your own pickle steps
|
106
|
-
|
123
|
+
|
107
124
|
|
108
125
|
== 0.4.0
|
109
126
|
Mongoid adapter, fallback ORM adapter for those not using machinist or active_record, bugfixes
|
@@ -111,9 +128,9 @@ Mongoid adapter, fallback ORM adapter for those not using machinist or active_re
|
|
111
128
|
* 2 major improvements
|
112
129
|
* adapter for Mongoid [Sebastian Zuchmanski]
|
113
130
|
* replace ActiveRecord 'factory' adapter with Orm adapter.
|
114
|
-
|
131
|
+
|
115
132
|
If you don't have machinist or factory_girl, the Orm factory adapter will fallback to your Orm to create classes.
|
116
|
-
|
133
|
+
|
117
134
|
BC: if you have a line like this:
|
118
135
|
Pickle.configure do |config|
|
119
136
|
config.adapters = [:active_record]
|
@@ -123,10 +140,10 @@ Mongoid adapter, fallback ORM adapter for those not using machinist or active_re
|
|
123
140
|
Pickle.configure do |config|
|
124
141
|
config.adapters = [:orm]
|
125
142
|
end
|
126
|
-
|
143
|
+
|
127
144
|
* 1 minor improvement
|
128
145
|
* Pickle::Session::ModelNotKnownError is raised instead of a generic RuntimeError
|
129
|
-
|
146
|
+
|
130
147
|
* 1 bugfix
|
131
148
|
* references to unknown models in fields now raise ModelNotKnownError instead of silently assigning nil
|
132
149
|
|
@@ -140,7 +157,7 @@ Mongoid adapter, fallback ORM adapter for those not using machinist or active_re
|
|
140
157
|
|
141
158
|
* 1 bugfix
|
142
159
|
* find_models now works with a factory name with spaces in it [#27]
|
143
|
-
|
160
|
+
|
144
161
|
|
145
162
|
== 0.3.4
|
146
163
|
|
@@ -153,7 +170,7 @@ Mongoid adapter, fallback ORM adapter for those not using machinist or active_re
|
|
153
170
|
|
154
171
|
* 1 minor improvement
|
155
172
|
* Pickle respects the default build strategy for factory girl. [Sean Hussey]
|
156
|
-
|
173
|
+
|
157
174
|
|
158
175
|
== 0.3.2
|
159
176
|
|
@@ -186,7 +203,7 @@ Mongoid adapter, fallback ORM adapter for those not using machinist or active_re
|
|
186
203
|
== 0.2.11
|
187
204
|
|
188
205
|
* 1 improvement
|
189
|
-
* use correct type when converting STI pickle model to attributes
|
206
|
+
* use correct type when converting STI pickle model to attributes
|
190
207
|
|
191
208
|
|
192
209
|
== 0.2.10
|
@@ -223,8 +240,8 @@ Mongoid adapter, fallback ORM adapter for those not using machinist or active_re
|
|
223
240
|
* 2 improvements
|
224
241
|
* running specs is now doable without being in a rails app - just do 'rake spec'
|
225
242
|
* running features is more straightforward, 'rake cucumber' then follow the instructions
|
226
|
-
|
227
|
-
|
243
|
+
|
244
|
+
|
228
245
|
== 0.2.5 - 17 Mar 2010
|
229
246
|
|
230
247
|
* 2 improvements
|
@@ -249,7 +266,7 @@ Mongoid adapter, fallback ORM adapter for those not using machinist or active_re
|
|
249
266
|
| user | name | status |
|
250
267
|
| jack | Jack Spratt | alone |
|
251
268
|
| pete | Pete Sprong | dead |
|
252
|
-
|
269
|
+
|
253
270
|
* 1 minor improvement
|
254
271
|
* Fix bug in error message for when pickle ref can't be found [Myron Marston]
|
255
272
|
|
@@ -260,8 +277,8 @@ Mongoid adapter, fallback ORM adapter for those not using machinist or active_re
|
|
260
277
|
* Added ability to follow links in emails (see email_steps.rb) [Michael Moen]
|
261
278
|
* Added a step definition for doing stuff like: Then the user's name should be "Tobi" [Tobi Knaup]
|
262
279
|
* Docfixes, mostly about testing [Nicholas Rutherford]
|
263
|
-
|
264
|
-
|
280
|
+
|
281
|
+
|
265
282
|
== 0.2.1 - 1 Dec 2009
|
266
283
|
|
267
284
|
* 2 minor improvements
|
@@ -280,11 +297,11 @@ Mongoid adapter, fallback ORM adapter for those not using machinist or active_re
|
|
280
297
|
| Ethel |
|
281
298
|
And the 1st user should be male
|
282
299
|
And the 2nd user should be female
|
283
|
-
|
300
|
+
|
284
301
|
* tables now support pickle refs in cells (see features/pickle/create_from_factory_girl.rb#37)
|
285
|
-
|
302
|
+
|
286
303
|
* features/support/email.rb adds an email helper for mapping names to email addresses (similar to NavigationHelper in paths.rb)
|
287
|
-
|
304
|
+
|
288
305
|
* Added ability for path_to_pickle to handle arbitrary segments
|
289
306
|
Example:
|
290
307
|
path_to_pickle('account', 'the enquiry') => account_enquiry_path(<enquiry>)
|
@@ -309,7 +326,7 @@ Mongoid adapter, fallback ORM adapter for those not using machinist or active_re
|
|
309
326
|
|
310
327
|
* 1 minor improvement
|
311
328
|
* docs: more links
|
312
|
-
|
329
|
+
|
313
330
|
|
314
331
|
== 0.1.22 - 7 Nov 2009
|
315
332
|
|
@@ -334,7 +351,7 @@ Mongoid adapter, fallback ORM adapter for those not using machinist or active_re
|
|
334
351
|
|
335
352
|
* 1 minor enhancement
|
336
353
|
* Add support for Cucumber tables [Tobi Knaup]
|
337
|
-
|
354
|
+
|
338
355
|
|
339
356
|
== 0.1.16, 0.1.17, 0.1.18 - 13 Oct 2009
|
340
357
|
|
@@ -354,7 +371,7 @@ Mongoid adapter, fallback ORM adapter for those not using machinist or active_re
|
|
354
371
|
* update specs and features for latest cucumber and machinist changes
|
355
372
|
|
356
373
|
|
357
|
-
== 0.1.13 - 16 June 2009
|
374
|
+
== 0.1.13 - 16 June 2009
|
358
375
|
|
359
376
|
* 2 minor enhancements
|
360
377
|
* model! and created_model! raise an error if pickle name can't be found
|
@@ -372,7 +389,7 @@ Mongoid adapter, fallback ORM adapter for those not using machinist or active_re
|
|
372
389
|
|
373
390
|
* 2 minor enhancements
|
374
391
|
* Pickle now supports multiple machinist blueprints
|
375
|
-
* Fix confusing adapter/adaptor comment generator comment
|
392
|
+
* Fix confusing adapter/adaptor comment generator comment
|
376
393
|
|
377
394
|
|
378
395
|
== 0.1.10 - 13 Feb 2009
|
@@ -403,7 +420,7 @@ Mongoid adapter, fallback ORM adapter for those not using machinist or active_re
|
|
403
420
|
* 2 API changes
|
404
421
|
* script/generate pickle path[s] now amends the features/support/paths.rb file
|
405
422
|
instead of creating pge_to_path and path_steps.
|
406
|
-
|
423
|
+
|
407
424
|
* pickle_email_steps is renamed email_steps
|
408
425
|
|
409
426
|
|
@@ -417,22 +434,22 @@ Mongoid adapter, fallback ORM adapter for those not using machinist or active_re
|
|
417
434
|
|
418
435
|
* generate email steps with `script/generate pickle email`
|
419
436
|
email steps allow you to do things like this:
|
420
|
-
|
437
|
+
|
421
438
|
Then 2 emails should be delivered
|
422
439
|
And the first email should be delivered to fred@gmail.com
|
423
440
|
And the 2nd email should be delivered to the user: "ethel"
|
424
|
-
|
441
|
+
|
425
442
|
Then 1 email should be delivered with subject: "Activate your account"
|
426
443
|
And the email should link to the user's page
|
427
|
-
|
444
|
+
|
428
445
|
take a look at features/step_definitions/pickle_email_steps.rb
|
429
|
-
|
446
|
+
|
430
447
|
* generate path steps with `script/generate pickle path`
|
431
448
|
path steps allow you to do things like this
|
432
|
-
|
449
|
+
|
433
450
|
When I go to the comment's page
|
434
451
|
Then I should be at the user's new comment page
|
435
|
-
|
452
|
+
|
436
453
|
take a look at features/step_definitions/pickle_path_steps.rb, and modify page_to_path to suit your needs
|
437
454
|
|
438
455
|
* 4 minor enhancements
|
@@ -457,7 +474,7 @@ Mongoid adapter, fallback ORM adapter for those not using machinist or active_re
|
|
457
474
|
for much more intuitive env.rb
|
458
475
|
|
459
476
|
* 2 minor enhancement
|
460
|
-
* predicate matching is less prone to step conflicts because we preload a
|
477
|
+
* predicate matching is less prone to step conflicts because we preload a
|
461
478
|
big list of all the predicate and column methods
|
462
479
|
* field values now handle booleans and numerics
|
463
480
|
|
@@ -483,7 +500,7 @@ Mongoid adapter, fallback ORM adapter for those not using machinist or active_re
|
|
483
500
|
* 2 major enhancements
|
484
501
|
* create your pickle steps with script/generate pickle
|
485
502
|
* Adapter based architecture, supports Machinist, FactoryGirl, and vanilla ActiveRecord
|
486
|
-
|
503
|
+
|
487
504
|
* 1 minor enhancement
|
488
505
|
* model_names now defaults to subclasses of AR::Base
|
489
506
|
* #original_model => #created_model
|
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# pickle
|
2
2
|
|
3
|
-
|
3
|
+
|
4
|
+
[](https://github.com/ianwhite/pickle/actions/workflows/build.yml)
|
4
5
|
|
5
6
|
Pickle gives you cucumber steps that create your models easily from factory-girl, machinist, or fabrication. You can also just use ActiveRecord as a factory but it's not as cool. Pickle can make use of different ORMs for finding records. Currently ActiveRecord, DataMapper, MongoID adapters are provided. More adapters welcome!
|
6
7
|
|
@@ -10,7 +11,18 @@ References to the models are stored in the current world, not necessarily for th
|
|
10
11
|
|
11
12
|
This is a quickstart guide for rails apps. Firstly, install [cucumber-rails](http://github.com/aslakhellesoy/cucumber-rails), and its dependencies. Then do the following:
|
12
13
|
|
13
|
-
|
14
|
+
## Supported versions
|
15
|
+
|
16
|
+
Cucumber 2.x - support was dropped from release 0.6.0
|
17
|
+
Cucumber 3.x - support is best-effort basis, but tests run on rails 4.2 all the way until 6.1
|
18
|
+
Cucumber 4.x - should work with all Rails 5.x versions, tests only run for 5.2 and 6.0
|
19
|
+
Cucumber 5.x - all tests pass for rails 5.2, 6.0 and 6.1
|
20
|
+
Cucumber 6.x - all tests pass for rails 6.0 and 6.1
|
21
|
+
|
22
|
+
Please open pull-requests with fixes if you encounter any problems.
|
23
|
+
No active development on this gem.
|
24
|
+
|
25
|
+
### Rails 5 and Rails 6
|
14
26
|
|
15
27
|
Add the gem to your Gemfile:
|
16
28
|
|
@@ -36,26 +48,6 @@ Run the generator, e.g:
|
|
36
48
|
rails g pickle --paths --email
|
37
49
|
```
|
38
50
|
|
39
|
-
### For Rails 2:
|
40
|
-
|
41
|
-
Add the following to config/environments/cucumber:
|
42
|
-
|
43
|
-
```ruby
|
44
|
-
config.gem 'pickle'
|
45
|
-
```
|
46
|
-
|
47
|
-
Install the gem with
|
48
|
-
|
49
|
-
```shell
|
50
|
-
rake gems:install RAILS_ENV=cucumber
|
51
|
-
```
|
52
|
-
|
53
|
-
Run the generator with:
|
54
|
-
|
55
|
-
```ruby
|
56
|
-
script/generate pickle [paths] [email]
|
57
|
-
```
|
58
|
-
|
59
51
|
## Resources
|
60
52
|
|
61
53
|
**GitHub** for code: https://github.com/ianwhite/pickle
|
@@ -88,7 +80,7 @@ Given a post exists with title: "My Post", body: "My body"
|
|
88
80
|
|
89
81
|
### Using with factory-girl or machinist
|
90
82
|
|
91
|
-
But you're using Machinist or
|
83
|
+
But you're using Machinist or FactoryBot right?! To leverage all of the factories/blueprints you've written, you can just do stuff like
|
92
84
|
|
93
85
|
```gherkin
|
94
86
|
Given a user exists
|
@@ -107,14 +99,14 @@ In your `features/support/env.rb` add the following lines at the bottom
|
|
107
99
|
require "#{Rails.root}/spec/blueprints" # or wherever they live
|
108
100
|
```
|
109
101
|
|
110
|
-
####
|
102
|
+
#### FactoryBot: make sure factories are loaded
|
111
103
|
|
112
104
|
In your config/environments/cucumber.rb file, make sure the factory-girl gem is included (unless it's installed as a plugin).
|
113
105
|
|
114
|
-
If that doesn't solve loading issues then require your factories.rb file directly in a file called 'features/support/
|
106
|
+
If that doesn't solve loading issues then require your factories.rb file directly in a file called 'features/support/factory_bot.rb'
|
115
107
|
|
116
108
|
```ruby
|
117
|
-
# example features/support/
|
109
|
+
# example features/support/factory_bot.rb
|
118
110
|
require File.dirname(__FILE__) + '/../../spec/factories'
|
119
111
|
```
|
120
112
|
|
@@ -174,7 +166,7 @@ Given a user exists with name: "Fred"
|
|
174
166
|
Given a user exists with name: "Fred", activated: false
|
175
167
|
```
|
176
168
|
|
177
|
-
This last step could be better expressed by using Machinist/
|
169
|
+
This last step could be better expressed by using Machinist/FactoryBot to create an activated user. Then you can do
|
178
170
|
|
179
171
|
```gherkin
|
180
172
|
Given an activated user exists with name: "Fred"
|