factory_bot_sequences 4.8.3
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 +7 -0
- data/.dockerignore +2 -0
- data/.gitignore +17 -0
- data/.travis.yml +27 -0
- data/.yardopts +5 -0
- data/Appraisals +12 -0
- data/Dockerfile +16 -0
- data/Gemfile +11 -0
- data/LICENSE +22 -0
- data/Makefile +7 -0
- data/README.md +275 -0
- data/Rakefile +18 -0
- data/factory_bot_sequences.gemspec +24 -0
- data/features/sequences.feature +27 -0
- data/features/step_definitions/rails_steps.rb +7 -0
- data/features/support/env.rb +7 -0
- data/gemfiles/rails_4.gemfile +16 -0
- data/gemfiles/rails_4.gemfile.lock +158 -0
- data/gemfiles/rails_5.gemfile +17 -0
- data/gemfiles/rails_5.gemfile.lock +174 -0
- data/lib/factory_bot_sequences.rb +2 -0
- data/lib/factory_bot_sequences/reload.rb +5 -0
- data/lib/factory_bot_sequences/sequences.rb +39 -0
- metadata +105 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: e8e4b3e627801e820cf49203ef83d5be930d5e00
|
4
|
+
data.tar.gz: 504e02ddc3083cd870026d24428771f94fb01ac6
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 4e698812ba5e3706018a70456d80a98d77334e4430e4df264ce76bd759c999704fd240be44b9a1a722d68e7bb8f1b52c5597a4e26c93a83c0218b68d75ef40e1
|
7
|
+
data.tar.gz: 4e397331fffbc70dc8cd4f50600bce7166ed0c12c79d90193e9ca066b8d5efa360dcae4249fecad2cf700f64f66da1bc357bbe3923d50ee389535a3cbd480f7e
|
data/.dockerignore
ADDED
data/.gitignore
ADDED
data/.travis.yml
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
sudo: false
|
2
|
+
|
3
|
+
rvm:
|
4
|
+
- 2.3.3
|
5
|
+
- ruby-head
|
6
|
+
- rbx-2
|
7
|
+
- jruby-head
|
8
|
+
|
9
|
+
matrix:
|
10
|
+
allow_failures:
|
11
|
+
- rvm: ruby-head
|
12
|
+
- rvm: rbx-2
|
13
|
+
- rvm: jruby-head
|
14
|
+
fast_finish: true
|
15
|
+
|
16
|
+
gemfile:
|
17
|
+
- gemfiles/rails_4.gemfile
|
18
|
+
- gemfiles/rails_5.gemfile
|
19
|
+
|
20
|
+
script: "bundle exec rake"
|
21
|
+
|
22
|
+
branches:
|
23
|
+
only:
|
24
|
+
- master
|
25
|
+
|
26
|
+
before_install:
|
27
|
+
- gem update bundler
|
data/.yardopts
ADDED
data/Appraisals
ADDED
data/Dockerfile
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
FROM ruby:latest
|
2
|
+
|
3
|
+
# fixes cucumber bug where it cannot find bundler
|
4
|
+
RUN gem install bundler --no-ri --no-rdoc
|
5
|
+
|
6
|
+
RUN mkdir -p /usr/src/lib
|
7
|
+
WORKDIR /usr/src/lib
|
8
|
+
|
9
|
+
COPY Gemfile* /usr/src/lib/
|
10
|
+
COPY *.gemspec /usr/src/lib/
|
11
|
+
RUN bundle install
|
12
|
+
|
13
|
+
COPY Appraisals /usr/src/lib/
|
14
|
+
RUN appraisal install
|
15
|
+
|
16
|
+
COPY . /usr/src/lib/
|
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 - 2017 Anton Kaliaev
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Makefile
ADDED
data/README.md
ADDED
@@ -0,0 +1,275 @@
|
|
1
|
+
# FactoryBotSequences [](http://travis-ci.org/nutsoriginal/factory_bot_sequences) [](http://badge.fury.io/rb/factory_girl_sequences)
|
2
|
+
|
3
|
+
Collection of useful [FactoryBot](http://github.com/thoughtbot/factory_bot)
|
4
|
+
sequences.
|
5
|
+
|
6
|
+
**Important**
|
7
|
+
|
8
|
+
This minigem provides only a basic set of standard data. If you need more complex
|
9
|
+
data in your application (e.g. US postal code or address), I recommend [Faker](http://github.com/stympy/faker).
|
10
|
+
|
11
|
+
## Installation
|
12
|
+
|
13
|
+
Add this line to your application's Gemfile:
|
14
|
+
|
15
|
+
gem 'factory_bot_sequences', :group => :test
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install factory_bot_sequences
|
20
|
+
|
21
|
+
## Sequences
|
22
|
+
|
23
|
+
<table>
|
24
|
+
<tr>
|
25
|
+
<th>Name</th>
|
26
|
+
<th>Aliases</th>
|
27
|
+
<th>DataType</th>
|
28
|
+
<th>Example</th>
|
29
|
+
</tr>
|
30
|
+
<tr>
|
31
|
+
<td>integer</td>
|
32
|
+
<td>checksum, int</td>
|
33
|
+
<td>Integer</td>
|
34
|
+
<td>1</td>
|
35
|
+
</tr>
|
36
|
+
<tr>
|
37
|
+
<td>string</td>
|
38
|
+
<td>-</td>
|
39
|
+
<td>String</td>
|
40
|
+
<td>string-1</td>
|
41
|
+
</tr>
|
42
|
+
<tr>
|
43
|
+
<td>date</td>
|
44
|
+
<td>-</td>
|
45
|
+
<td>Date</td>
|
46
|
+
<td>Sat, 20 Oct 2012</td>
|
47
|
+
</tr>
|
48
|
+
<tr>
|
49
|
+
<td>datetime</td>
|
50
|
+
<td>-</td>
|
51
|
+
<td>Time</td>
|
52
|
+
<td>Sat, 20 Oct 2012 16:38:59 MSK +04:00</td>
|
53
|
+
</tr>
|
54
|
+
<tr>
|
55
|
+
<td>boolean</td>
|
56
|
+
<td>-</td>
|
57
|
+
<td>Boolean</td>
|
58
|
+
<td>true</td>
|
59
|
+
</tr>
|
60
|
+
<tr>
|
61
|
+
<td>uuid</td>
|
62
|
+
<td>guid</td>
|
63
|
+
<td>String</td>
|
64
|
+
<td>0a4ea40d-e7ed-4fc1-890c-7af86c9c3a07</td>
|
65
|
+
</tr>
|
66
|
+
<tr>
|
67
|
+
<td>name</td>
|
68
|
+
<td>login, username, first_name, last_name</td>
|
69
|
+
<td>String</td>
|
70
|
+
<td>name-1</td>
|
71
|
+
</tr>
|
72
|
+
<tr>
|
73
|
+
<td>password</td>
|
74
|
+
<td>-</td>
|
75
|
+
<td>String</td>
|
76
|
+
<td>password-1</td>
|
77
|
+
</tr>
|
78
|
+
<tr>
|
79
|
+
<td>email</td>
|
80
|
+
<td>-</td>
|
81
|
+
<td>String</td>
|
82
|
+
<td>person1@example.com</td>
|
83
|
+
</tr>
|
84
|
+
<tr>
|
85
|
+
<td>port</td>
|
86
|
+
<td>-</td>
|
87
|
+
<td>Integer</td>
|
88
|
+
<td>1025</td>
|
89
|
+
</tr>
|
90
|
+
<tr>
|
91
|
+
<td>ip_address</td>
|
92
|
+
<td>-</td>
|
93
|
+
<td>String</td>
|
94
|
+
<td>192.168.0.1</td>
|
95
|
+
</tr>
|
96
|
+
<tr>
|
97
|
+
<td>ip_subnet</td>
|
98
|
+
<td>-</td>
|
99
|
+
<td>String</td>
|
100
|
+
<td>192.168.10.0</td>
|
101
|
+
</tr>
|
102
|
+
<tr>
|
103
|
+
<td>mac_address</td>
|
104
|
+
<td>-</td>
|
105
|
+
<td>String</td>
|
106
|
+
<td>01:23:45:67:89:01</td>
|
107
|
+
</tr>
|
108
|
+
<tr>
|
109
|
+
<td>title</td>
|
110
|
+
<td>-</td>
|
111
|
+
<td>String</td>
|
112
|
+
<td>Title 1</td>
|
113
|
+
</tr>
|
114
|
+
<tr>
|
115
|
+
<td>body</td>
|
116
|
+
<td>description, text, content</td>
|
117
|
+
<td>String</td>
|
118
|
+
<td>body-1</td>
|
119
|
+
</tr>
|
120
|
+
<tr>
|
121
|
+
<td>slug</td>
|
122
|
+
<td>-</td>
|
123
|
+
<td>String</td>
|
124
|
+
<td>slug-1</td>
|
125
|
+
</tr>
|
126
|
+
<tr>
|
127
|
+
<td>url</td>
|
128
|
+
<td>-</td>
|
129
|
+
<td>String</td>
|
130
|
+
<td>http://example1.com</td>
|
131
|
+
</tr>
|
132
|
+
<tr>
|
133
|
+
<td>domain</td>
|
134
|
+
<td>-</td>
|
135
|
+
<td>String</td>
|
136
|
+
<td>example1.com</td>
|
137
|
+
</tr>
|
138
|
+
<tr>
|
139
|
+
<td>subdomain</td>
|
140
|
+
<td>-</td>
|
141
|
+
<td>String</td>
|
142
|
+
<td>blog1</td>
|
143
|
+
</tr>
|
144
|
+
<tr>
|
145
|
+
<td>color</td>
|
146
|
+
<td>-</td>
|
147
|
+
<td>String</td>
|
148
|
+
<td>333333</td>
|
149
|
+
</tr>
|
150
|
+
<tr>
|
151
|
+
<td>timestamp</td>
|
152
|
+
<td>-</td>
|
153
|
+
<td>Fixnum</td>
|
154
|
+
<td>1374582311</td>
|
155
|
+
</tr>
|
156
|
+
<tr>
|
157
|
+
<td>token</td>
|
158
|
+
<td>-</td>
|
159
|
+
<td>String</td>
|
160
|
+
<td>JS74sef41ZosXek1ndvY</td>
|
161
|
+
</tr>
|
162
|
+
<tr>
|
163
|
+
<td>seat</td>
|
164
|
+
<td>-</td>
|
165
|
+
<td>String</td>
|
166
|
+
<td>01A</td>
|
167
|
+
</tr>
|
168
|
+
</table>
|
169
|
+
|
170
|
+
## Usage
|
171
|
+
|
172
|
+
Basic example:
|
173
|
+
|
174
|
+
```ruby
|
175
|
+
FactoryBot.generate :email
|
176
|
+
# => "person1@example.com"
|
177
|
+
|
178
|
+
FactoryBot.generate :email
|
179
|
+
# => "person2@example.com"
|
180
|
+
```
|
181
|
+
|
182
|
+
Use them as attributes (preferable way):
|
183
|
+
|
184
|
+
```ruby
|
185
|
+
factory :user do
|
186
|
+
email
|
187
|
+
end
|
188
|
+
```
|
189
|
+
|
190
|
+
Or in lazy attributes:
|
191
|
+
|
192
|
+
```ruby
|
193
|
+
factory :invite do
|
194
|
+
invitee { generate(:email) }
|
195
|
+
end
|
196
|
+
```
|
197
|
+
|
198
|
+
Check out FactoryBot's [GETTING_STARTED](http://github.com/thoughtbot/factory_bot) for more information.
|
199
|
+
|
200
|
+
### Spork or TConsole
|
201
|
+
|
202
|
+
For whose of you who are using spork or tconsole, consider adding `FactoryBotSequences.reload` right after `FactoryBot.reload`.
|
203
|
+
|
204
|
+
## Contributing
|
205
|
+
|
206
|
+
1. Fork it
|
207
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
208
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
209
|
+
4. Test your changes by running `bundle exec rake cucumber` command
|
210
|
+
5. Push to the branch (`git push origin my-new-feature`)
|
211
|
+
6. Create new Pull Request
|
212
|
+
|
213
|
+
## Credits
|
214
|
+
|
215
|
+
Created by [Anton Kaliaev](http://github.com/melekes)
|
216
|
+
|
217
|
+
Thank you to all our amazing [contributors](http://github.com/melekes/factory_girl_sequences/contributors)!
|
218
|
+
|
219
|
+
## Changelog
|
220
|
+
|
221
|
+
### 4.8.3 / 2017-11-01
|
222
|
+
|
223
|
+
* migrate to factory_bot
|
224
|
+
|
225
|
+
### 4.8.0 / 2017-01-14
|
226
|
+
|
227
|
+
* updated dependencies (`activesupport >= 4.2`)
|
228
|
+
|
229
|
+
### 4.3.1 / 2014-08-08
|
230
|
+
|
231
|
+
* added few aliases [Kirill Platonov]
|
232
|
+
|
233
|
+
### 4.3.0 / 2014-07-31
|
234
|
+
|
235
|
+
* added uuid sequence [Kirill Platonov]
|
236
|
+
|
237
|
+
### 4.2.0 / 2014-01-09
|
238
|
+
|
239
|
+
* added a seat sequence [Hans Lemuet]
|
240
|
+
|
241
|
+
### 4.1.0 / 2013-11-14
|
242
|
+
|
243
|
+
* added port and token sequences [Andrew Kulakov]
|
244
|
+
* aliased body as text / content [Andrew Kulakov]
|
245
|
+
|
246
|
+
### 4.0.0 / 2013-02-22
|
247
|
+
|
248
|
+
* updated factory_girl version
|
249
|
+
* added appraisal
|
250
|
+
* rewrite tests
|
251
|
+
* created separate reload method
|
252
|
+
|
253
|
+
### 0.1.1 / 2012-10-27
|
254
|
+
|
255
|
+
* Updated README
|
256
|
+
|
257
|
+
### 0.1.0 / 2012-10-24
|
258
|
+
|
259
|
+
* Added url sequence
|
260
|
+
* Fixed slug sequence
|
261
|
+
* Updated README
|
262
|
+
|
263
|
+
### 0.0.4 / 2012-10-20
|
264
|
+
|
265
|
+
* Added travis-ci
|
266
|
+
* Added extra options for docs
|
267
|
+
|
268
|
+
### 0.0.3 / 2012-10-20
|
269
|
+
|
270
|
+
* Pathed FactoryBot.reload to add default sequences
|
271
|
+
|
272
|
+
### 0.0.3 / 2012-10-20
|
273
|
+
|
274
|
+
* Updated README
|
275
|
+
* Added link to the homepage
|
data/Rakefile
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
require 'rubygems'
|
3
|
+
require 'bundler'
|
4
|
+
require 'rake'
|
5
|
+
require 'appraisal'
|
6
|
+
require 'cucumber/rake/task'
|
7
|
+
|
8
|
+
Cucumber::Rake::Task.new(:cucumber) do |t|
|
9
|
+
t.cucumber_opts = ['--format', (ENV['CUCUMBER_FORMAT'] || 'progress')]
|
10
|
+
end
|
11
|
+
|
12
|
+
task test_suite: [:cucumber]
|
13
|
+
|
14
|
+
if !ENV['APPRAISAL_INITIALIZED'] && !ENV['TRAVIS']
|
15
|
+
task :default => :appraisal
|
16
|
+
else
|
17
|
+
task default: :test_suite
|
18
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |gem|
|
4
|
+
gem.name = "factory_bot_sequences"
|
5
|
+
gem.version = "4.8.3"
|
6
|
+
gem.authors = ["Mikhail Rekhov"]
|
7
|
+
gem.email = ["nutsoriginal@gamil.com"]
|
8
|
+
gem.description = %q{factory_bot_sequences provides a collection of useful FactoryBot sequences}
|
9
|
+
gem.summary = %q{Collection of useful FactoryBot sequences}
|
10
|
+
gem.homepage = "http://github.com/nutsoriginal/factory_bot_sequences"
|
11
|
+
gem.license = "MIT"
|
12
|
+
|
13
|
+
gem.files = `git ls-files`.split($\)
|
14
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
15
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
16
|
+
|
17
|
+
gem.require_paths = ["lib"]
|
18
|
+
|
19
|
+
gem.rdoc_options = %w(--line-numbers --inline-source --title factory_bot_sequences --main README.md)
|
20
|
+
gem.extra_rdoc_files = %w(README.md LICENSE)
|
21
|
+
|
22
|
+
gem.add_dependency 'factory_bot', '~> 4.0'
|
23
|
+
gem.add_dependency 'activesupport', '>= 4.2'
|
24
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# @announce-output
|
2
|
+
Feature:
|
3
|
+
I would like Factory Bot Sequences gem to automatically register sequences
|
4
|
+
|
5
|
+
Background:
|
6
|
+
Given I successfully run `bundle exec rails new testapp --skip-bundle --skip-sprockets --skip-javascript`
|
7
|
+
And I cd to "testapp"
|
8
|
+
And I add "factory_bot_rails" as a dependency
|
9
|
+
And I add "factory_bot_sequences" from this project as a dependency
|
10
|
+
|
11
|
+
Scenario: Using Factory Bot Sequences registers predefined sequences
|
12
|
+
And I run `bundle install`
|
13
|
+
And I run `bundle exec rails generate model User name`
|
14
|
+
And I run `bundle exec rake db:migrate`
|
15
|
+
When I write to "test/unit/user_test.rb" with:
|
16
|
+
"""
|
17
|
+
require 'test_helper'
|
18
|
+
|
19
|
+
class UserTest < ActiveSupport::TestCase
|
20
|
+
test "factory_bot should know name sequence" do
|
21
|
+
user = FactoryBot.create(:user)
|
22
|
+
assert user.name
|
23
|
+
end
|
24
|
+
end
|
25
|
+
"""
|
26
|
+
And I run `bundle exec rake test`
|
27
|
+
Then the output should contain "1 runs, 1 assertions, 0 failures, 0 errors, 0 skips"
|
@@ -0,0 +1,7 @@
|
|
1
|
+
When /^I add "([^"]+)" from this project as a dependency$/ do |gem_name|
|
2
|
+
append_to_file('Gemfile', %{gem "#{gem_name}", :path => "#{PROJECT_ROOT}"\n})
|
3
|
+
end
|
4
|
+
|
5
|
+
When /^I add "([^"]+)" as a dependency$/ do |gem_name|
|
6
|
+
append_to_file('Gemfile', %{gem "#{gem_name}"\n})
|
7
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# This file was generated by Appraisal
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
gem "rake"
|
6
|
+
gem "rails", "~> 4.2.7"
|
7
|
+
gem "sqlite3"
|
8
|
+
gem "factory_bot_rails"
|
9
|
+
|
10
|
+
group :test do
|
11
|
+
gem "cucumber", "~> 2.4.0"
|
12
|
+
gem "aruba", "~> 0.14.2"
|
13
|
+
gem "appraisal", "~> 2.1"
|
14
|
+
end
|
15
|
+
|
16
|
+
gemspec path: "../"
|
@@ -0,0 +1,158 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ..
|
3
|
+
specs:
|
4
|
+
factory_bot_sequences (4.8.2)
|
5
|
+
activesupport (>= 4.2)
|
6
|
+
factory_bot (~> 4.0)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
actionmailer (4.2.10)
|
12
|
+
actionpack (= 4.2.10)
|
13
|
+
actionview (= 4.2.10)
|
14
|
+
activejob (= 4.2.10)
|
15
|
+
mail (~> 2.5, >= 2.5.4)
|
16
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
17
|
+
actionpack (4.2.10)
|
18
|
+
actionview (= 4.2.10)
|
19
|
+
activesupport (= 4.2.10)
|
20
|
+
rack (~> 1.6)
|
21
|
+
rack-test (~> 0.6.2)
|
22
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
23
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
24
|
+
actionview (4.2.10)
|
25
|
+
activesupport (= 4.2.10)
|
26
|
+
builder (~> 3.1)
|
27
|
+
erubis (~> 2.7.0)
|
28
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
29
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
30
|
+
activejob (4.2.10)
|
31
|
+
activesupport (= 4.2.10)
|
32
|
+
globalid (>= 0.3.0)
|
33
|
+
activemodel (4.2.10)
|
34
|
+
activesupport (= 4.2.10)
|
35
|
+
builder (~> 3.1)
|
36
|
+
activerecord (4.2.10)
|
37
|
+
activemodel (= 4.2.10)
|
38
|
+
activesupport (= 4.2.10)
|
39
|
+
arel (~> 6.0)
|
40
|
+
activesupport (4.2.10)
|
41
|
+
i18n (~> 0.7)
|
42
|
+
minitest (~> 5.1)
|
43
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
44
|
+
tzinfo (~> 1.1)
|
45
|
+
appraisal (2.2.0)
|
46
|
+
bundler
|
47
|
+
rake
|
48
|
+
thor (>= 0.14.0)
|
49
|
+
arel (6.0.4)
|
50
|
+
aruba (0.14.2)
|
51
|
+
childprocess (~> 0.5.6)
|
52
|
+
contracts (~> 0.9)
|
53
|
+
cucumber (>= 1.3.19)
|
54
|
+
ffi (~> 1.9.10)
|
55
|
+
rspec-expectations (>= 2.99)
|
56
|
+
thor (~> 0.19)
|
57
|
+
builder (3.2.3)
|
58
|
+
childprocess (0.5.9)
|
59
|
+
ffi (~> 1.0, >= 1.0.11)
|
60
|
+
concurrent-ruby (1.0.5)
|
61
|
+
contracts (0.16.0)
|
62
|
+
crass (1.0.2)
|
63
|
+
cucumber (2.4.0)
|
64
|
+
builder (>= 2.1.2)
|
65
|
+
cucumber-core (~> 1.5.0)
|
66
|
+
cucumber-wire (~> 0.0.1)
|
67
|
+
diff-lcs (>= 1.1.3)
|
68
|
+
gherkin (~> 4.0)
|
69
|
+
multi_json (>= 1.7.5, < 2.0)
|
70
|
+
multi_test (>= 0.1.2)
|
71
|
+
cucumber-core (1.5.0)
|
72
|
+
gherkin (~> 4.0)
|
73
|
+
cucumber-wire (0.0.1)
|
74
|
+
diff-lcs (1.3)
|
75
|
+
erubis (2.7.0)
|
76
|
+
factory_bot (4.8.2)
|
77
|
+
activesupport (>= 3.0.0)
|
78
|
+
factory_bot_rails (4.8.2)
|
79
|
+
factory_bot (~> 4.8.2)
|
80
|
+
railties (>= 3.0.0)
|
81
|
+
ffi (1.9.18)
|
82
|
+
gherkin (4.1.3)
|
83
|
+
globalid (0.4.1)
|
84
|
+
activesupport (>= 4.2.0)
|
85
|
+
i18n (0.9.0)
|
86
|
+
concurrent-ruby (~> 1.0)
|
87
|
+
loofah (2.1.1)
|
88
|
+
crass (~> 1.0.2)
|
89
|
+
nokogiri (>= 1.5.9)
|
90
|
+
mail (2.7.0)
|
91
|
+
mini_mime (>= 0.1.1)
|
92
|
+
mini_mime (0.1.4)
|
93
|
+
mini_portile2 (2.3.0)
|
94
|
+
minitest (5.10.3)
|
95
|
+
multi_json (1.12.2)
|
96
|
+
multi_test (0.1.2)
|
97
|
+
nokogiri (1.8.1)
|
98
|
+
mini_portile2 (~> 2.3.0)
|
99
|
+
rack (1.6.8)
|
100
|
+
rack-test (0.6.3)
|
101
|
+
rack (>= 1.0)
|
102
|
+
rails (4.2.10)
|
103
|
+
actionmailer (= 4.2.10)
|
104
|
+
actionpack (= 4.2.10)
|
105
|
+
actionview (= 4.2.10)
|
106
|
+
activejob (= 4.2.10)
|
107
|
+
activemodel (= 4.2.10)
|
108
|
+
activerecord (= 4.2.10)
|
109
|
+
activesupport (= 4.2.10)
|
110
|
+
bundler (>= 1.3.0, < 2.0)
|
111
|
+
railties (= 4.2.10)
|
112
|
+
sprockets-rails
|
113
|
+
rails-deprecated_sanitizer (1.0.3)
|
114
|
+
activesupport (>= 4.2.0.alpha)
|
115
|
+
rails-dom-testing (1.0.8)
|
116
|
+
activesupport (>= 4.2.0.beta, < 5.0)
|
117
|
+
nokogiri (~> 1.6)
|
118
|
+
rails-deprecated_sanitizer (>= 1.0.1)
|
119
|
+
rails-html-sanitizer (1.0.3)
|
120
|
+
loofah (~> 2.0)
|
121
|
+
railties (4.2.10)
|
122
|
+
actionpack (= 4.2.10)
|
123
|
+
activesupport (= 4.2.10)
|
124
|
+
rake (>= 0.8.7)
|
125
|
+
thor (>= 0.18.1, < 2.0)
|
126
|
+
rake (12.2.1)
|
127
|
+
rspec-expectations (3.7.0)
|
128
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
129
|
+
rspec-support (~> 3.7.0)
|
130
|
+
rspec-support (3.7.0)
|
131
|
+
sprockets (3.7.1)
|
132
|
+
concurrent-ruby (~> 1.0)
|
133
|
+
rack (> 1, < 3)
|
134
|
+
sprockets-rails (3.2.1)
|
135
|
+
actionpack (>= 4.0)
|
136
|
+
activesupport (>= 4.0)
|
137
|
+
sprockets (>= 3.0.0)
|
138
|
+
sqlite3 (1.3.13)
|
139
|
+
thor (0.20.0)
|
140
|
+
thread_safe (0.3.6)
|
141
|
+
tzinfo (1.2.4)
|
142
|
+
thread_safe (~> 0.1)
|
143
|
+
|
144
|
+
PLATFORMS
|
145
|
+
ruby
|
146
|
+
|
147
|
+
DEPENDENCIES
|
148
|
+
appraisal (~> 2.1)
|
149
|
+
aruba (~> 0.14.2)
|
150
|
+
cucumber (~> 2.4.0)
|
151
|
+
factory_bot_rails
|
152
|
+
factory_bot_sequences!
|
153
|
+
rails (~> 4.2.7)
|
154
|
+
rake
|
155
|
+
sqlite3
|
156
|
+
|
157
|
+
BUNDLED WITH
|
158
|
+
1.14.6
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# This file was generated by Appraisal
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
gem "rake"
|
6
|
+
gem "rails", "~> 5.1"
|
7
|
+
gem "sqlite3"
|
8
|
+
gem "factory_bot_rails"
|
9
|
+
gem "listen"
|
10
|
+
|
11
|
+
group :test do
|
12
|
+
gem "cucumber", "~> 2.4.0"
|
13
|
+
gem "aruba", "~> 0.14.2"
|
14
|
+
gem "appraisal", "~> 2.1"
|
15
|
+
end
|
16
|
+
|
17
|
+
gemspec path: "../"
|
@@ -0,0 +1,174 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ..
|
3
|
+
specs:
|
4
|
+
factory_bot_sequences (4.8.2)
|
5
|
+
activesupport (>= 4.2)
|
6
|
+
factory_bot (~> 4.0)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
actioncable (5.1.4)
|
12
|
+
actionpack (= 5.1.4)
|
13
|
+
nio4r (~> 2.0)
|
14
|
+
websocket-driver (~> 0.6.1)
|
15
|
+
actionmailer (5.1.4)
|
16
|
+
actionpack (= 5.1.4)
|
17
|
+
actionview (= 5.1.4)
|
18
|
+
activejob (= 5.1.4)
|
19
|
+
mail (~> 2.5, >= 2.5.4)
|
20
|
+
rails-dom-testing (~> 2.0)
|
21
|
+
actionpack (5.1.4)
|
22
|
+
actionview (= 5.1.4)
|
23
|
+
activesupport (= 5.1.4)
|
24
|
+
rack (~> 2.0)
|
25
|
+
rack-test (>= 0.6.3)
|
26
|
+
rails-dom-testing (~> 2.0)
|
27
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
28
|
+
actionview (5.1.4)
|
29
|
+
activesupport (= 5.1.4)
|
30
|
+
builder (~> 3.1)
|
31
|
+
erubi (~> 1.4)
|
32
|
+
rails-dom-testing (~> 2.0)
|
33
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
34
|
+
activejob (5.1.4)
|
35
|
+
activesupport (= 5.1.4)
|
36
|
+
globalid (>= 0.3.6)
|
37
|
+
activemodel (5.1.4)
|
38
|
+
activesupport (= 5.1.4)
|
39
|
+
activerecord (5.1.4)
|
40
|
+
activemodel (= 5.1.4)
|
41
|
+
activesupport (= 5.1.4)
|
42
|
+
arel (~> 8.0)
|
43
|
+
activesupport (5.1.4)
|
44
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
45
|
+
i18n (~> 0.7)
|
46
|
+
minitest (~> 5.1)
|
47
|
+
tzinfo (~> 1.1)
|
48
|
+
appraisal (2.2.0)
|
49
|
+
bundler
|
50
|
+
rake
|
51
|
+
thor (>= 0.14.0)
|
52
|
+
arel (8.0.0)
|
53
|
+
aruba (0.14.2)
|
54
|
+
childprocess (~> 0.5.6)
|
55
|
+
contracts (~> 0.9)
|
56
|
+
cucumber (>= 1.3.19)
|
57
|
+
ffi (~> 1.9.10)
|
58
|
+
rspec-expectations (>= 2.99)
|
59
|
+
thor (~> 0.19)
|
60
|
+
builder (3.2.3)
|
61
|
+
childprocess (0.5.9)
|
62
|
+
ffi (~> 1.0, >= 1.0.11)
|
63
|
+
concurrent-ruby (1.0.5)
|
64
|
+
contracts (0.16.0)
|
65
|
+
crass (1.0.2)
|
66
|
+
cucumber (2.4.0)
|
67
|
+
builder (>= 2.1.2)
|
68
|
+
cucumber-core (~> 1.5.0)
|
69
|
+
cucumber-wire (~> 0.0.1)
|
70
|
+
diff-lcs (>= 1.1.3)
|
71
|
+
gherkin (~> 4.0)
|
72
|
+
multi_json (>= 1.7.5, < 2.0)
|
73
|
+
multi_test (>= 0.1.2)
|
74
|
+
cucumber-core (1.5.0)
|
75
|
+
gherkin (~> 4.0)
|
76
|
+
cucumber-wire (0.0.1)
|
77
|
+
diff-lcs (1.3)
|
78
|
+
erubi (1.7.0)
|
79
|
+
factory_bot (4.8.2)
|
80
|
+
activesupport (>= 3.0.0)
|
81
|
+
factory_bot_rails (4.8.2)
|
82
|
+
factory_bot (~> 4.8.2)
|
83
|
+
railties (>= 3.0.0)
|
84
|
+
ffi (1.9.18)
|
85
|
+
gherkin (4.1.3)
|
86
|
+
globalid (0.4.1)
|
87
|
+
activesupport (>= 4.2.0)
|
88
|
+
i18n (0.9.0)
|
89
|
+
concurrent-ruby (~> 1.0)
|
90
|
+
listen (3.1.5)
|
91
|
+
rb-fsevent (~> 0.9, >= 0.9.4)
|
92
|
+
rb-inotify (~> 0.9, >= 0.9.7)
|
93
|
+
ruby_dep (~> 1.2)
|
94
|
+
loofah (2.1.1)
|
95
|
+
crass (~> 1.0.2)
|
96
|
+
nokogiri (>= 1.5.9)
|
97
|
+
mail (2.7.0)
|
98
|
+
mini_mime (>= 0.1.1)
|
99
|
+
method_source (0.9.0)
|
100
|
+
mini_mime (0.1.4)
|
101
|
+
mini_portile2 (2.3.0)
|
102
|
+
minitest (5.10.3)
|
103
|
+
multi_json (1.12.2)
|
104
|
+
multi_test (0.1.2)
|
105
|
+
nio4r (2.1.0)
|
106
|
+
nokogiri (1.8.1)
|
107
|
+
mini_portile2 (~> 2.3.0)
|
108
|
+
rack (2.0.3)
|
109
|
+
rack-test (0.7.0)
|
110
|
+
rack (>= 1.0, < 3)
|
111
|
+
rails (5.1.4)
|
112
|
+
actioncable (= 5.1.4)
|
113
|
+
actionmailer (= 5.1.4)
|
114
|
+
actionpack (= 5.1.4)
|
115
|
+
actionview (= 5.1.4)
|
116
|
+
activejob (= 5.1.4)
|
117
|
+
activemodel (= 5.1.4)
|
118
|
+
activerecord (= 5.1.4)
|
119
|
+
activesupport (= 5.1.4)
|
120
|
+
bundler (>= 1.3.0)
|
121
|
+
railties (= 5.1.4)
|
122
|
+
sprockets-rails (>= 2.0.0)
|
123
|
+
rails-dom-testing (2.0.3)
|
124
|
+
activesupport (>= 4.2.0)
|
125
|
+
nokogiri (>= 1.6)
|
126
|
+
rails-html-sanitizer (1.0.3)
|
127
|
+
loofah (~> 2.0)
|
128
|
+
railties (5.1.4)
|
129
|
+
actionpack (= 5.1.4)
|
130
|
+
activesupport (= 5.1.4)
|
131
|
+
method_source
|
132
|
+
rake (>= 0.8.7)
|
133
|
+
thor (>= 0.18.1, < 2.0)
|
134
|
+
rake (12.2.1)
|
135
|
+
rb-fsevent (0.10.2)
|
136
|
+
rb-inotify (0.9.10)
|
137
|
+
ffi (>= 0.5.0, < 2)
|
138
|
+
rspec-expectations (3.7.0)
|
139
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
140
|
+
rspec-support (~> 3.7.0)
|
141
|
+
rspec-support (3.7.0)
|
142
|
+
ruby_dep (1.5.0)
|
143
|
+
sprockets (3.7.1)
|
144
|
+
concurrent-ruby (~> 1.0)
|
145
|
+
rack (> 1, < 3)
|
146
|
+
sprockets-rails (3.2.1)
|
147
|
+
actionpack (>= 4.0)
|
148
|
+
activesupport (>= 4.0)
|
149
|
+
sprockets (>= 3.0.0)
|
150
|
+
sqlite3 (1.3.13)
|
151
|
+
thor (0.20.0)
|
152
|
+
thread_safe (0.3.6)
|
153
|
+
tzinfo (1.2.4)
|
154
|
+
thread_safe (~> 0.1)
|
155
|
+
websocket-driver (0.6.5)
|
156
|
+
websocket-extensions (>= 0.1.0)
|
157
|
+
websocket-extensions (0.1.2)
|
158
|
+
|
159
|
+
PLATFORMS
|
160
|
+
ruby
|
161
|
+
|
162
|
+
DEPENDENCIES
|
163
|
+
appraisal (~> 2.1)
|
164
|
+
aruba (~> 0.14.2)
|
165
|
+
cucumber (~> 2.4.0)
|
166
|
+
factory_bot_rails
|
167
|
+
factory_bot_sequences!
|
168
|
+
listen
|
169
|
+
rails (~> 5.1)
|
170
|
+
rake
|
171
|
+
sqlite3
|
172
|
+
|
173
|
+
BUNDLED WITH
|
174
|
+
1.14.6
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module FactoryBot
|
2
|
+
|
3
|
+
def self.register_default_sequences
|
4
|
+
# basic types
|
5
|
+
register_sequence(Sequence.new(:integer, :aliases => [:checksum, :int]) { |n| n })
|
6
|
+
register_sequence(Sequence.new(:string) { |n| "string-#{n}" })
|
7
|
+
register_sequence(Sequence.new(:date) { Date.current })
|
8
|
+
register_sequence(Sequence.new(:datetime) { Time.current })
|
9
|
+
register_sequence(Sequence.new(:boolean) { |n| [false, true][n%2] })
|
10
|
+
|
11
|
+
# personal
|
12
|
+
register_sequence(Sequence.new(:uuid, :aliases => [:guid]) { SecureRandom.uuid })
|
13
|
+
register_sequence(Sequence.new(:name, :aliases => [:login, :username, :first_name, :last_name]) { |n| "name-#{n}" })
|
14
|
+
register_sequence(Sequence.new(:password) { |n| "password-#{n}" })
|
15
|
+
register_sequence(Sequence.new(:email) { |n| "person#{n}@example.com" })
|
16
|
+
|
17
|
+
# network
|
18
|
+
register_sequence(Sequence.new(:port) { |n| (1024 + n % 49151) })
|
19
|
+
register_sequence(Sequence.new(:ip_address) { |n| "192.168.0.#{n%256}" })
|
20
|
+
register_sequence(Sequence.new(:ip_subnet) { |n| "192.168.#{n%256}.0" })
|
21
|
+
register_sequence(Sequence.new(:mac_address) { |n| "01:23:45:67:89:" + ("%02x" % "#{n%256}") })
|
22
|
+
|
23
|
+
# post (or article)
|
24
|
+
register_sequence(Sequence.new(:title) { |n| "Title #{n}" })
|
25
|
+
register_sequence(Sequence.new(:body, :aliases => [:description, :text, :content]) { |n| "body-#{n}" })
|
26
|
+
register_sequence(Sequence.new(:slug) { |n| "slug_#{n}" })
|
27
|
+
|
28
|
+
# other
|
29
|
+
register_sequence(Sequence.new(:url) { |n| "http://example#{n}.com" })
|
30
|
+
register_sequence(Sequence.new(:domain) { |n| "example#{n}.com" })
|
31
|
+
register_sequence(Sequence.new(:subdomain) { |n| "blog#{n}" })
|
32
|
+
register_sequence(Sequence.new(:color) { |n| "%06d" % n })
|
33
|
+
register_sequence(Sequence.new(:timestamp) { Time.current.to_i })
|
34
|
+
register_sequence(Sequence.new(:token) { |n| SecureRandom.base64(15).tr('+/=lIO0', "token#{n}") })
|
35
|
+
register_sequence(Sequence.new(:seat, 0) { |n| "%02d%s" % [n % 50 + 1, ('A'..'Z').to_a[n / 50 % 26]] })
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
FactoryBot.register_default_sequences
|
metadata
ADDED
@@ -0,0 +1,105 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: factory_bot_sequences
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 4.8.3
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Mikhail Rekhov
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-11-01 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: factory_bot
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '4.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '4.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: activesupport
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '4.2'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '4.2'
|
41
|
+
description: factory_bot_sequences provides a collection of useful FactoryBot sequences
|
42
|
+
email:
|
43
|
+
- nutsoriginal@gamil.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files:
|
47
|
+
- README.md
|
48
|
+
- LICENSE
|
49
|
+
files:
|
50
|
+
- ".dockerignore"
|
51
|
+
- ".gitignore"
|
52
|
+
- ".travis.yml"
|
53
|
+
- ".yardopts"
|
54
|
+
- Appraisals
|
55
|
+
- Dockerfile
|
56
|
+
- Gemfile
|
57
|
+
- LICENSE
|
58
|
+
- Makefile
|
59
|
+
- README.md
|
60
|
+
- Rakefile
|
61
|
+
- factory_bot_sequences.gemspec
|
62
|
+
- features/sequences.feature
|
63
|
+
- features/step_definitions/rails_steps.rb
|
64
|
+
- features/support/env.rb
|
65
|
+
- gemfiles/rails_4.gemfile
|
66
|
+
- gemfiles/rails_4.gemfile.lock
|
67
|
+
- gemfiles/rails_5.gemfile
|
68
|
+
- gemfiles/rails_5.gemfile.lock
|
69
|
+
- lib/factory_bot_sequences.rb
|
70
|
+
- lib/factory_bot_sequences/reload.rb
|
71
|
+
- lib/factory_bot_sequences/sequences.rb
|
72
|
+
homepage: http://github.com/nutsoriginal/factory_bot_sequences
|
73
|
+
licenses:
|
74
|
+
- MIT
|
75
|
+
metadata: {}
|
76
|
+
post_install_message:
|
77
|
+
rdoc_options:
|
78
|
+
- "--line-numbers"
|
79
|
+
- "--inline-source"
|
80
|
+
- "--title"
|
81
|
+
- factory_bot_sequences
|
82
|
+
- "--main"
|
83
|
+
- README.md
|
84
|
+
require_paths:
|
85
|
+
- lib
|
86
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0'
|
91
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0'
|
96
|
+
requirements: []
|
97
|
+
rubyforge_project:
|
98
|
+
rubygems_version: 2.6.10
|
99
|
+
signing_key:
|
100
|
+
specification_version: 4
|
101
|
+
summary: Collection of useful FactoryBot sequences
|
102
|
+
test_files:
|
103
|
+
- features/sequences.feature
|
104
|
+
- features/step_definitions/rails_steps.rb
|
105
|
+
- features/support/env.rb
|