fabricators 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MIT-LICENSE +1 -1
- data/README.md +149 -0
- data/lib/fabricators/version.rb +1 -1
- data/test/aliases_test.rb +1 -1
- data/test/associations_test.rb +2 -2
- data/test/attributes_test.rb +2 -2
- data/test/callbacks_test.rb +2 -2
- data/test/clean_test.rb +1 -1
- data/test/dependent_test.rb +3 -3
- data/test/dummy/config/environments/production.rb +5 -1
- data/test/dummy/config/environments/test.rb +9 -1
- data/test/dummy/log/test.log +540 -0
- data/test/fabricators_test.rb +3 -3
- data/test/generators_test.rb +1 -1
- data/test/inheritance_test.rb +3 -3
- data/test/lists_test.rb +2 -2
- data/test/load_test.rb +1 -1
- data/test/merges_test.rb +3 -3
- metadata +8 -8
- data/README.rdoc +0 -127
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac6cf966777bb3f16621eea86a87bd9c0af77c64
|
4
|
+
data.tar.gz: 9b32910999dc3c6385e309f3dd5d2fc32ac4d03c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5223db0976bbe2ca6d55361b894d7c4b9b6a08d57bf894b81d08db820f5d179b3a00911195bb11b21e4d07b6fe9a3b634ddd9adaea9c19df7f174e022ab4546
|
7
|
+
data.tar.gz: 1d7825c6488dc7558dba7386b56323d056708038c35950e1ce71568257678ca03bb836fc4757c7a8c27a7270c042b5c87793e30f94ff053ccf3475898b3a29aa
|
data/MIT-LICENSE
CHANGED
data/README.md
ADDED
@@ -0,0 +1,149 @@
|
|
1
|
+
[![Gem Version](https://badge.fury.io/rb/fabricators.svg)](http://badge.fury.io/rb/fabricators) [![Code Climate](https://codeclimate.com/github/museways/fabricators/badges/gpa.svg)](https://codeclimate.com/github/museways/fabricators) [![Build Status](https://travis-ci.org/museways/fabricators.svg?branch=0.1.0)](https://travis-ci.org/museways/fabricators) [![Dependency Status](https://gemnasium.com/museways/fabricators.svg)](https://gemnasium.com/museways/fabricators)
|
2
|
+
|
3
|
+
# Fabricators
|
4
|
+
|
5
|
+
Minimalistic factory inspired in factory_girl for rails.
|
6
|
+
|
7
|
+
## Install
|
8
|
+
|
9
|
+
Put this line in your Gemfile:
|
10
|
+
```ruby
|
11
|
+
gem 'fabricators', group: [:development, :test]
|
12
|
+
```
|
13
|
+
|
14
|
+
Then bundle:
|
15
|
+
```
|
16
|
+
$ bundle
|
17
|
+
```
|
18
|
+
|
19
|
+
## Configuration
|
20
|
+
|
21
|
+
There is no need to configure anything, all this is done automatically for rspec and minitest:
|
22
|
+
|
23
|
+
* Loading the definitions.
|
24
|
+
* Replacing the fixtures generators.
|
25
|
+
* Including the methods inside your testing framework.
|
26
|
+
* Cleaning the database after each test.
|
27
|
+
|
28
|
+
## Usage
|
29
|
+
|
30
|
+
### Methods
|
31
|
+
|
32
|
+
There are three methods available:
|
33
|
+
```ruby
|
34
|
+
attributes_for
|
35
|
+
build
|
36
|
+
create
|
37
|
+
```
|
38
|
+
|
39
|
+
Is possible to override the defaults passing a hash:
|
40
|
+
```ruby
|
41
|
+
build :user, name: 'other'
|
42
|
+
create :category, title: 'other'
|
43
|
+
```
|
44
|
+
|
45
|
+
To create lists just pass the desired size as second parameter to build and create methods:
|
46
|
+
```ruby
|
47
|
+
build :user, 2, name: 'other'
|
48
|
+
create :category, 5, title: 'other'
|
49
|
+
```
|
50
|
+
|
51
|
+
### Fabricators
|
52
|
+
|
53
|
+
Define them in a ruby file inside test/fabricators or spec/fabricators folders:
|
54
|
+
```ruby
|
55
|
+
fabricator :user do
|
56
|
+
name 'example'
|
57
|
+
end
|
58
|
+
```
|
59
|
+
|
60
|
+
### Inheritance
|
61
|
+
|
62
|
+
Can be declare nested or separated:
|
63
|
+
```ruby
|
64
|
+
fabricator :user do
|
65
|
+
name 'example'
|
66
|
+
fabricator :user_with_email do
|
67
|
+
email 'example@mail.com'
|
68
|
+
end
|
69
|
+
end
|
70
|
+
fabricator :user_with_age, parent: :user do
|
71
|
+
age 9
|
72
|
+
end
|
73
|
+
```
|
74
|
+
|
75
|
+
### Sequences
|
76
|
+
|
77
|
+
Generates an unique sequence of numbers for the attribute of the fabricator:
|
78
|
+
```ruby
|
79
|
+
fabricator :user do
|
80
|
+
sequence(:email) { |n| "example#{n}@mail.com" }
|
81
|
+
sequence(:age)
|
82
|
+
end
|
83
|
+
```
|
84
|
+
|
85
|
+
### Associations
|
86
|
+
|
87
|
+
Associations are used by name:
|
88
|
+
```ruby
|
89
|
+
fabricator :user do
|
90
|
+
posts
|
91
|
+
comments 4 # You can customize the number of records
|
92
|
+
end
|
93
|
+
fabricator :post do
|
94
|
+
user
|
95
|
+
end
|
96
|
+
fabricator :comment do
|
97
|
+
user
|
98
|
+
end
|
99
|
+
```
|
100
|
+
|
101
|
+
### Aliases
|
102
|
+
|
103
|
+
The aliases are important when there is the need of context:
|
104
|
+
```ruby
|
105
|
+
fabricators :user, aliases: :author do
|
106
|
+
comments
|
107
|
+
end
|
108
|
+
fabricators :post, aliases: :comment do
|
109
|
+
title
|
110
|
+
author
|
111
|
+
end
|
112
|
+
```
|
113
|
+
|
114
|
+
### Dependent attributes
|
115
|
+
|
116
|
+
If you need to use some logic that depends of another attribute you can use a block or sequence:
|
117
|
+
```ruby
|
118
|
+
fabricators :user do
|
119
|
+
name 'example'
|
120
|
+
email { "#{name}@mail.com" }
|
121
|
+
sequence(:username) { |n| "#{name}-#{n}" }
|
122
|
+
end
|
123
|
+
```
|
124
|
+
|
125
|
+
### Callbacks
|
126
|
+
|
127
|
+
The available callbacks are before(:build), before(:create), after(:build) and after(:create):
|
128
|
+
```ruby
|
129
|
+
fabricator :user do
|
130
|
+
after(:build) { |u| u.name = 'sample' }
|
131
|
+
end
|
132
|
+
```
|
133
|
+
|
134
|
+
You can declare global callbacks in your test or spec helper as well:
|
135
|
+
```ruby
|
136
|
+
Fabricators.configure do
|
137
|
+
after(:create) do |object|
|
138
|
+
log object.errors unless object.valid?
|
139
|
+
end
|
140
|
+
end
|
141
|
+
```
|
142
|
+
|
143
|
+
## Credits
|
144
|
+
|
145
|
+
This gem is maintained and funded by [museways](http://museways.com).
|
146
|
+
|
147
|
+
## License
|
148
|
+
|
149
|
+
It is free software, and may be redistributed under the terms specified in the MIT-LICENSE file.
|
data/lib/fabricators/version.rb
CHANGED
data/test/aliases_test.rb
CHANGED
@@ -11,7 +11,7 @@ class AliasesTest < ActiveSupport::TestCase
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
-
test
|
14
|
+
test 'aliases' do
|
15
15
|
assert_kind_of Fabricators::Fabricator, Fabricators.definitions.find(:user)
|
16
16
|
assert_kind_of Fabricators::Fabricator, Fabricators.definitions.find(:owner)
|
17
17
|
assert_kind_of Fabricators::Fabricator, Fabricators.definitions.find(:author)
|
data/test/associations_test.rb
CHANGED
@@ -23,7 +23,7 @@ class AssociationsTest < ActiveSupport::TestCase
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
test
|
26
|
+
test 'belongs to association' do
|
27
27
|
user = build(:post_with_built_user).user
|
28
28
|
assert_kind_of User, user
|
29
29
|
assert user.new_record?
|
@@ -33,7 +33,7 @@ class AssociationsTest < ActiveSupport::TestCase
|
|
33
33
|
assert user.persisted?
|
34
34
|
end
|
35
35
|
|
36
|
-
test
|
36
|
+
test 'has many association' do
|
37
37
|
posts = build(:user_with_built_posts).posts
|
38
38
|
assert_equal 1, posts.size
|
39
39
|
post = posts.first
|
data/test/attributes_test.rb
CHANGED
@@ -11,13 +11,13 @@ class AttributesTest < ActiveSupport::TestCase
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
-
test
|
14
|
+
test 'block sequence' do
|
15
15
|
assert_equal 'mail1@example.com', attributes_for(:user)[:email]
|
16
16
|
assert_equal 'mail2@example.com', build(:user).email
|
17
17
|
assert_equal 'mail3@example.com', create(:user).email
|
18
18
|
end
|
19
19
|
|
20
|
-
test
|
20
|
+
test 'numeric sequence' do
|
21
21
|
assert_equal 1, attributes_for(:user)[:age]
|
22
22
|
assert_equal 2, build(:user).age
|
23
23
|
assert_equal 3, create(:user).age
|
data/test/callbacks_test.rb
CHANGED
@@ -19,7 +19,7 @@ class CallbacksTest < ActiveSupport::TestCase
|
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
-
test
|
22
|
+
test 'build callbacks' do
|
23
23
|
user = build(:user)
|
24
24
|
assert_equal 'build@example.com', user.email
|
25
25
|
assert_equal 1, user.phone
|
@@ -27,7 +27,7 @@ class CallbacksTest < ActiveSupport::TestCase
|
|
27
27
|
assert_equal 1, user.age
|
28
28
|
end
|
29
29
|
|
30
|
-
test
|
30
|
+
test 'create callbacks' do
|
31
31
|
user = create(:user)
|
32
32
|
assert_equal 'create@example.com', user.email
|
33
33
|
assert_equal 2, user.phone
|
data/test/clean_test.rb
CHANGED
data/test/dependent_test.rb
CHANGED
@@ -12,17 +12,17 @@ class DependentTest < ActiveSupport::TestCase
|
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
|
-
test
|
15
|
+
test 'return attributes' do
|
16
16
|
assert_equal 'name-1', attributes_for(:user)[:username]
|
17
17
|
assert_equal 'name@example.com', attributes_for(:user)[:email]
|
18
18
|
end
|
19
19
|
|
20
|
-
test
|
20
|
+
test 'build instance' do
|
21
21
|
assert_equal 'name-1', build(:user).username
|
22
22
|
assert_equal 'name@example.com', build(:user).email
|
23
23
|
end
|
24
24
|
|
25
|
-
test
|
25
|
+
test 'create instance' do
|
26
26
|
assert_equal 'name-1', create(:user).username
|
27
27
|
assert_equal 'name@example.com', create(:user).email
|
28
28
|
end
|
@@ -20,7 +20,11 @@ Dummy::Application.configure do
|
|
20
20
|
# config.action_dispatch.rack_cache = true
|
21
21
|
|
22
22
|
# Disable Rails's static asset server (Apache or nginx will already do this).
|
23
|
-
|
23
|
+
if Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR >= 2
|
24
|
+
config.serve_static_files = false
|
25
|
+
else
|
26
|
+
config.serve_static_assets = false
|
27
|
+
end
|
24
28
|
|
25
29
|
# Compress JavaScripts and CSS.
|
26
30
|
config.assets.js_compressor = :uglifier
|
@@ -13,7 +13,11 @@ Dummy::Application.configure do
|
|
13
13
|
config.eager_load = false
|
14
14
|
|
15
15
|
# Configure static asset server for tests with Cache-Control for performance.
|
16
|
-
|
16
|
+
if Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR >= 2
|
17
|
+
config.serve_static_files = false
|
18
|
+
else
|
19
|
+
config.serve_static_assets = false
|
20
|
+
end
|
17
21
|
config.static_cache_control = 'public, max-age=3600'
|
18
22
|
|
19
23
|
# Show full error reports and disable caching.
|
@@ -36,4 +40,8 @@ Dummy::Application.configure do
|
|
36
40
|
|
37
41
|
# Raises error for missing translations
|
38
42
|
# config.action_view.raise_on_missing_translations = true
|
43
|
+
|
44
|
+
if Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR >= 2
|
45
|
+
config.active_support.test_order = :random
|
46
|
+
end
|
39
47
|
end
|
data/test/dummy/log/test.log
CHANGED
@@ -22551,3 +22551,543 @@ MergesTest: test_create_instance
|
|
22551
22551
|
MergesTest: test_return_attributes
|
22552
22552
|
----------------------------------
|
22553
22553
|
[1m[35m (0.0ms)[0m rollback transaction
|
22554
|
+
[1m[36m (0.4ms)[0m [1mCREATE TABLE "posts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "content" varchar(255), "user_id" integer, "created_at" datetime, "updated_at" datetime) [0m
|
22555
|
+
[1m[35m (0.2ms)[0m CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "username" varchar(255), "name" varchar(255), "email" varchar(255), "age" integer, "phone" integer, "created_at" datetime, "updated_at" datetime)
|
22556
|
+
[1m[36m (0.1ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
22557
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
22558
|
+
[1m[36m (0.1ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
22559
|
+
[1m[35m (0.0ms)[0m SELECT version FROM "schema_migrations"
|
22560
|
+
[1m[36m (0.1ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20140615180954')[0m
|
22561
|
+
[1m[35m (0.1ms)[0m begin transaction
|
22562
|
+
-------------------------
|
22563
|
+
LoadTest: test_find_files
|
22564
|
+
-------------------------
|
22565
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
22566
|
+
[1m[35m (0.0ms)[0m begin transaction
|
22567
|
+
------------------------------------
|
22568
|
+
InheritanceTest: test_build_instance
|
22569
|
+
------------------------------------
|
22570
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
22571
|
+
[1m[35m (0.0ms)[0m begin transaction
|
22572
|
+
-------------------------------------
|
22573
|
+
InheritanceTest: test_create_instance
|
22574
|
+
-------------------------------------
|
22575
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
22576
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "users" ("age", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["age", 9], ["created_at", "2014-09-17 01:30:10.916398"], ["name", "name"], ["updated_at", "2014-09-17 01:30:10.916398"]]
|
22577
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
22578
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
22579
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "users" ("created_at", "email", "name", "updated_at") VALUES (?, ?, ?, ?)[0m [["created_at", "2014-09-17 01:30:10.919705"], ["email", "mail@example.com"], ["name", "name"], ["updated_at", "2014-09-17 01:30:10.919705"]]
|
22580
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
22581
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
22582
|
+
[1m[35mSQL (0.1ms)[0m DELETE FROM "users" WHERE "users"."id" = ? [["id", 2]]
|
22583
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
22584
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
22585
|
+
[1m[36mSQL (0.0ms)[0m [1mDELETE FROM "users" WHERE "users"."id" = ?[0m [["id", 1]]
|
22586
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
22587
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
22588
|
+
[1m[35m (0.1ms)[0m begin transaction
|
22589
|
+
---------------------------------------
|
22590
|
+
InheritanceTest: test_return_attributes
|
22591
|
+
---------------------------------------
|
22592
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
22593
|
+
[1m[35m (0.0ms)[0m begin transaction
|
22594
|
+
-----------------------------------
|
22595
|
+
AttributesTest: test_block_sequence
|
22596
|
+
-----------------------------------
|
22597
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
22598
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "users" ("age", "created_at", "email", "updated_at") VALUES (?, ?, ?, ?) [["age", 3], ["created_at", "2014-09-17 01:30:10.924370"], ["email", "mail3@example.com"], ["updated_at", "2014-09-17 01:30:10.924370"]]
|
22599
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
22600
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
22601
|
+
[1m[36mSQL (0.0ms)[0m [1mDELETE FROM "users" WHERE "users"."id" = ?[0m [["id", 1]]
|
22602
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
22603
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
22604
|
+
[1m[35m (0.0ms)[0m begin transaction
|
22605
|
+
-------------------------------------
|
22606
|
+
AttributesTest: test_numeric_sequence
|
22607
|
+
-------------------------------------
|
22608
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
22609
|
+
[1m[35mSQL (0.0ms)[0m INSERT INTO "users" ("age", "created_at", "email", "updated_at") VALUES (?, ?, ?, ?) [["age", 3], ["created_at", "2014-09-17 01:30:10.926632"], ["email", "mail3@example.com"], ["updated_at", "2014-09-17 01:30:10.926632"]]
|
22610
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
22611
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
22612
|
+
[1m[36mSQL (0.0ms)[0m [1mDELETE FROM "users" WHERE "users"."id" = ?[0m [["id", 1]]
|
22613
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
22614
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
22615
|
+
[1m[35m (0.0ms)[0m begin transaction
|
22616
|
+
------------------------------------
|
22617
|
+
GeneratorsTest: test_file_generation
|
22618
|
+
------------------------------------
|
22619
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
22620
|
+
[1m[35m (0.0ms)[0m begin transaction
|
22621
|
+
-----------------------------------
|
22622
|
+
CallbacksTest: test_build_callbacks
|
22623
|
+
-----------------------------------
|
22624
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
22625
|
+
[1m[35m (0.0ms)[0m begin transaction
|
22626
|
+
------------------------------------
|
22627
|
+
CallbacksTest: test_create_callbacks
|
22628
|
+
------------------------------------
|
22629
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
22630
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "users" ("age", "created_at", "email", "name", "phone", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["age", 1], ["created_at", "2014-09-17 01:30:10.933598"], ["email", "create@example.com"], ["name", "create"], ["phone", 1], ["updated_at", "2014-09-17 01:30:10.933598"]]
|
22631
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
22632
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
22633
|
+
[1m[36mSQL (0.1ms)[0m [1mDELETE FROM "users" WHERE "users"."id" = ?[0m [["id", 1]]
|
22634
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
22635
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
22636
|
+
[1m[35m (0.1ms)[0m begin transaction
|
22637
|
+
-------------------------------------
|
22638
|
+
CleanTest: test_clean_records_created
|
22639
|
+
-------------------------------------
|
22640
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
22641
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2014-09-17 01:30:10.937761"], ["updated_at", "2014-09-17 01:30:10.937761"]]
|
22642
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
22643
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
22644
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?)[0m [["created_at", "2014-09-17 01:30:10.938899"], ["updated_at", "2014-09-17 01:30:10.938899"]]
|
22645
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
22646
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
22647
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2014-09-17 01:30:10.939796"], ["updated_at", "2014-09-17 01:30:10.939796"]]
|
22648
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
22649
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
22650
|
+
[1m[36mSQL (0.0ms)[0m [1mINSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?)[0m [["created_at", "2014-09-17 01:30:10.940730"], ["updated_at", "2014-09-17 01:30:10.940730"]]
|
22651
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
22652
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
22653
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2014-09-17 01:30:10.941621"], ["updated_at", "2014-09-17 01:30:10.941621"]]
|
22654
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
22655
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
22656
|
+
[1m[36mSQL (0.0ms)[0m [1mDELETE FROM "users" WHERE "users"."id" = ?[0m [["id", 5]]
|
22657
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
22658
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
22659
|
+
[1m[35mSQL (0.0ms)[0m DELETE FROM "users" WHERE "users"."id" = ? [["id", 4]]
|
22660
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
22661
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
22662
|
+
[1m[36mSQL (0.0ms)[0m [1mDELETE FROM "users" WHERE "users"."id" = ?[0m [["id", 3]]
|
22663
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
22664
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
22665
|
+
[1m[35mSQL (0.0ms)[0m DELETE FROM "users" WHERE "users"."id" = ? [["id", 2]]
|
22666
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
22667
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
22668
|
+
[1m[36mSQL (0.0ms)[0m [1mDELETE FROM "users" WHERE "users"."id" = ?[0m [["id", 1]]
|
22669
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
22670
|
+
[1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "users"[0m
|
22671
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
22672
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
22673
|
+
-------------------------
|
22674
|
+
AliasesTest: test_aliases
|
22675
|
+
-------------------------
|
22676
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
22677
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
22678
|
+
------------------------------------
|
22679
|
+
FabricatorsTest: test_build_instance
|
22680
|
+
------------------------------------
|
22681
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
22682
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
22683
|
+
-------------------------------------
|
22684
|
+
FabricatorsTest: test_create_instance
|
22685
|
+
-------------------------------------
|
22686
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
22687
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "users" ("created_at", "name", "updated_at") VALUES (?, ?, ?)[0m [["created_at", "2014-09-17 01:30:10.950084"], ["name", "name"], ["updated_at", "2014-09-17 01:30:10.950084"]]
|
22688
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
22689
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
22690
|
+
[1m[35mSQL (0.0ms)[0m DELETE FROM "users" WHERE "users"."id" = ? [["id", 1]]
|
22691
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
22692
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
22693
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
22694
|
+
---------------------------------------
|
22695
|
+
FabricatorsTest: test_return_attributes
|
22696
|
+
---------------------------------------
|
22697
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
22698
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
22699
|
+
----------------------------------
|
22700
|
+
DependentTest: test_build_instance
|
22701
|
+
----------------------------------
|
22702
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
22703
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
22704
|
+
-----------------------------------
|
22705
|
+
DependentTest: test_create_instance
|
22706
|
+
-----------------------------------
|
22707
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
22708
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "users" ("created_at", "email", "name", "updated_at", "username") VALUES (?, ?, ?, ?, ?)[0m [["created_at", "2014-09-17 01:30:10.954370"], ["email", "name@example.com"], ["name", "name"], ["updated_at", "2014-09-17 01:30:10.954370"], ["username", "name-1"]]
|
22709
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
22710
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
22711
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "users" ("created_at", "email", "name", "updated_at", "username") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-09-17 01:30:10.955504"], ["email", "name@example.com"], ["name", "name"], ["updated_at", "2014-09-17 01:30:10.955504"], ["username", "name-2"]]
|
22712
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
22713
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
22714
|
+
[1m[36mSQL (0.0ms)[0m [1mDELETE FROM "users" WHERE "users"."id" = ?[0m [["id", 2]]
|
22715
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
22716
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
22717
|
+
[1m[35mSQL (0.0ms)[0m DELETE FROM "users" WHERE "users"."id" = ? [["id", 1]]
|
22718
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
22719
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
22720
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
22721
|
+
-------------------------------------
|
22722
|
+
DependentTest: test_return_attributes
|
22723
|
+
-------------------------------------
|
22724
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
22725
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
22726
|
+
--------------------------
|
22727
|
+
ListsTest: test_build_list
|
22728
|
+
--------------------------
|
22729
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
22730
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
22731
|
+
---------------------------
|
22732
|
+
ListsTest: test_create_list
|
22733
|
+
---------------------------
|
22734
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
22735
|
+
[1m[36mSQL (0.0ms)[0m [1mINSERT INTO "users" ("created_at", "name", "updated_at") VALUES (?, ?, ?)[0m [["created_at", "2014-09-17 01:30:10.959893"], ["name", "name"], ["updated_at", "2014-09-17 01:30:10.959893"]]
|
22736
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
22737
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
22738
|
+
[1m[35mSQL (0.0ms)[0m INSERT INTO "users" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2014-09-17 01:30:10.960883"], ["name", "name"], ["updated_at", "2014-09-17 01:30:10.960883"]]
|
22739
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
22740
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
22741
|
+
[1m[36mSQL (0.0ms)[0m [1mINSERT INTO "users" ("created_at", "name", "updated_at") VALUES (?, ?, ?)[0m [["created_at", "2014-09-17 01:30:10.961772"], ["name", "name"], ["updated_at", "2014-09-17 01:30:10.961772"]]
|
22742
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
22743
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
22744
|
+
[1m[35mSQL (0.1ms)[0m DELETE FROM "users" WHERE "users"."id" = ? [["id", 3]]
|
22745
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
22746
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
22747
|
+
[1m[36mSQL (0.0ms)[0m [1mDELETE FROM "users" WHERE "users"."id" = ?[0m [["id", 2]]
|
22748
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
22749
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
22750
|
+
[1m[35mSQL (0.0ms)[0m DELETE FROM "users" WHERE "users"."id" = ? [["id", 1]]
|
22751
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
22752
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
22753
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
22754
|
+
-------------------------------
|
22755
|
+
MergesTest: test_build_instance
|
22756
|
+
-------------------------------
|
22757
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
22758
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
22759
|
+
--------------------------------
|
22760
|
+
MergesTest: test_create_instance
|
22761
|
+
--------------------------------
|
22762
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
22763
|
+
[1m[36mSQL (0.0ms)[0m [1mINSERT INTO "users" ("created_at", "name", "updated_at") VALUES (?, ?, ?)[0m [["created_at", "2014-09-17 01:30:10.966049"], ["name", "other"], ["updated_at", "2014-09-17 01:30:10.966049"]]
|
22764
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
22765
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
22766
|
+
[1m[35mSQL (0.0ms)[0m INSERT INTO "users" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2014-09-17 01:30:10.967010"], ["name", "other"], ["updated_at", "2014-09-17 01:30:10.967010"]]
|
22767
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
22768
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
22769
|
+
[1m[36mSQL (0.0ms)[0m [1mINSERT INTO "users" ("created_at", "name", "updated_at") VALUES (?, ?, ?)[0m [["created_at", "2014-09-17 01:30:10.967967"], ["name", "other"], ["updated_at", "2014-09-17 01:30:10.967967"]]
|
22770
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
22771
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
22772
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "users" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2014-09-17 01:30:10.968894"], ["name", "other"], ["updated_at", "2014-09-17 01:30:10.968894"]]
|
22773
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
22774
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
22775
|
+
[1m[36mSQL (0.0ms)[0m [1mDELETE FROM "users" WHERE "users"."id" = ?[0m [["id", 4]]
|
22776
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
22777
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
22778
|
+
[1m[35mSQL (0.0ms)[0m DELETE FROM "users" WHERE "users"."id" = ? [["id", 3]]
|
22779
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
22780
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
22781
|
+
[1m[36mSQL (0.0ms)[0m [1mDELETE FROM "users" WHERE "users"."id" = ?[0m [["id", 2]]
|
22782
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
22783
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
22784
|
+
[1m[35mSQL (0.0ms)[0m DELETE FROM "users" WHERE "users"."id" = ? [["id", 1]]
|
22785
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
22786
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
22787
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
22788
|
+
----------------------------------
|
22789
|
+
MergesTest: test_return_attributes
|
22790
|
+
----------------------------------
|
22791
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
22792
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
22793
|
+
---------------------------------------------
|
22794
|
+
AssociationsTest: test_belongs_to_association
|
22795
|
+
---------------------------------------------
|
22796
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
22797
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?)[0m [["created_at", "2014-09-17 01:30:10.982822"], ["updated_at", "2014-09-17 01:30:10.982822"]]
|
22798
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
22799
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
22800
|
+
[1m[35mSQL (0.0ms)[0m DELETE FROM "users" WHERE "users"."id" = ? [["id", 1]]
|
22801
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
22802
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
22803
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
22804
|
+
-------------------------------------------
|
22805
|
+
AssociationsTest: test_has_many_association
|
22806
|
+
-------------------------------------------
|
22807
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
22808
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "posts" ("created_at", "updated_at") VALUES (?, ?)[0m [["created_at", "2014-09-17 01:30:10.994993"], ["updated_at", "2014-09-17 01:30:10.994993"]]
|
22809
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
22810
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
22811
|
+
[1m[35mSQL (0.0ms)[0m INSERT INTO "posts" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2014-09-17 01:30:10.996227"], ["updated_at", "2014-09-17 01:30:10.996227"]]
|
22812
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
22813
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
22814
|
+
[1m[36mSQL (0.1ms)[0m [1mDELETE FROM "posts" WHERE "posts"."id" = ?[0m [["id", 2]]
|
22815
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
22816
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
22817
|
+
[1m[35mSQL (0.0ms)[0m DELETE FROM "posts" WHERE "posts"."id" = ? [["id", 1]]
|
22818
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
22819
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
22820
|
+
[1m[36m (0.4ms)[0m [1mCREATE TABLE "posts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "content" varchar, "user_id" integer, "created_at" datetime, "updated_at" datetime) [0m
|
22821
|
+
[1m[35m (0.3ms)[0m CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "username" varchar, "name" varchar, "email" varchar, "age" integer, "phone" integer, "created_at" datetime, "updated_at" datetime)
|
22822
|
+
[1m[36m (0.1ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
22823
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
22824
|
+
[1m[36m (0.1ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
22825
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
22826
|
+
[1m[36m (0.1ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20140615180954')[0m
|
22827
|
+
[1m[35m (0.1ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20140613221835')
|
22828
|
+
[1m[36m (0.6ms)[0m [1mCREATE TABLE "posts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "content" varchar, "user_id" integer, "created_at" datetime, "updated_at" datetime) [0m
|
22829
|
+
[1m[35m (0.4ms)[0m CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "username" varchar, "name" varchar, "email" varchar, "age" integer, "phone" integer, "created_at" datetime, "updated_at" datetime)
|
22830
|
+
[1m[36m (0.2ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
22831
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
22832
|
+
[1m[36m (0.2ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
22833
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
22834
|
+
[1m[36m (0.1ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20140615180954')[0m
|
22835
|
+
[1m[35m (0.1ms)[0m begin transaction
|
22836
|
+
-------------------------------
|
22837
|
+
MergesTest: test_build_instance
|
22838
|
+
-------------------------------
|
22839
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
22840
|
+
[1m[35m (0.0ms)[0m begin transaction
|
22841
|
+
----------------------------------
|
22842
|
+
MergesTest: test_return_attributes
|
22843
|
+
----------------------------------
|
22844
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
22845
|
+
[1m[35m (0.0ms)[0m begin transaction
|
22846
|
+
--------------------------------
|
22847
|
+
MergesTest: test_create_instance
|
22848
|
+
--------------------------------
|
22849
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
22850
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "users" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "other"], ["created_at", "2015-02-15 23:27:45.532028"], ["updated_at", "2015-02-15 23:27:45.532028"]]
|
22851
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
22852
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
22853
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "users" ("name", "created_at", "updated_at") VALUES (?, ?, ?)[0m [["name", "other"], ["created_at", "2015-02-15 23:27:45.535698"], ["updated_at", "2015-02-15 23:27:45.535698"]]
|
22854
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
22855
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
22856
|
+
[1m[35mSQL (0.0ms)[0m INSERT INTO "users" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "other"], ["created_at", "2015-02-15 23:27:45.537183"], ["updated_at", "2015-02-15 23:27:45.537183"]]
|
22857
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
22858
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
22859
|
+
[1m[36mSQL (0.0ms)[0m [1mINSERT INTO "users" ("name", "created_at", "updated_at") VALUES (?, ?, ?)[0m [["name", "other"], ["created_at", "2015-02-15 23:27:45.538434"], ["updated_at", "2015-02-15 23:27:45.538434"]]
|
22860
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
22861
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
22862
|
+
[1m[35mSQL (0.1ms)[0m DELETE FROM "users" WHERE "users"."id" = ? [["id", 4]]
|
22863
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
22864
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
22865
|
+
[1m[36mSQL (0.0ms)[0m [1mDELETE FROM "users" WHERE "users"."id" = ?[0m [["id", 3]]
|
22866
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
22867
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
22868
|
+
[1m[35mSQL (0.0ms)[0m DELETE FROM "users" WHERE "users"."id" = ? [["id", 2]]
|
22869
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
22870
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
22871
|
+
[1m[36mSQL (0.0ms)[0m [1mDELETE FROM "users" WHERE "users"."id" = ?[0m [["id", 1]]
|
22872
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
22873
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
22874
|
+
[1m[35m (0.0ms)[0m begin transaction
|
22875
|
+
-----------------------------------
|
22876
|
+
CallbacksTest: test_build_callbacks
|
22877
|
+
-----------------------------------
|
22878
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
22879
|
+
[1m[35m (0.0ms)[0m begin transaction
|
22880
|
+
------------------------------------
|
22881
|
+
CallbacksTest: test_create_callbacks
|
22882
|
+
------------------------------------
|
22883
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
22884
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "users" ("email", "name", "phone", "age", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["email", "create@example.com"], ["name", "create"], ["phone", 1], ["age", 1], ["created_at", "2015-02-15 23:27:45.545454"], ["updated_at", "2015-02-15 23:27:45.545454"]]
|
22885
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
22886
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
22887
|
+
[1m[36mSQL (0.1ms)[0m [1mDELETE FROM "users" WHERE "users"."id" = ?[0m [["id", 1]]
|
22888
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
22889
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
22890
|
+
[1m[35m (0.0ms)[0m begin transaction
|
22891
|
+
---------------------------------------------
|
22892
|
+
AssociationsTest: test_belongs_to_association
|
22893
|
+
---------------------------------------------
|
22894
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
22895
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-02-15 23:27:45.563673"], ["updated_at", "2015-02-15 23:27:45.563673"]]
|
22896
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
22897
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
22898
|
+
[1m[36mSQL (0.1ms)[0m [1mDELETE FROM "users" WHERE "users"."id" = ?[0m [["id", 1]]
|
22899
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
22900
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
22901
|
+
[1m[35m (0.1ms)[0m begin transaction
|
22902
|
+
-------------------------------------------
|
22903
|
+
AssociationsTest: test_has_many_association
|
22904
|
+
-------------------------------------------
|
22905
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
22906
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "posts" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-02-15 23:27:45.576171"], ["updated_at", "2015-02-15 23:27:45.576171"]]
|
22907
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
22908
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
22909
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "posts" ("created_at", "updated_at") VALUES (?, ?)[0m [["created_at", "2015-02-15 23:27:45.577580"], ["updated_at", "2015-02-15 23:27:45.577580"]]
|
22910
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
22911
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
22912
|
+
[1m[35mSQL (0.1ms)[0m DELETE FROM "posts" WHERE "posts"."id" = ? [["id", 2]]
|
22913
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
22914
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
22915
|
+
[1m[36mSQL (0.0ms)[0m [1mDELETE FROM "posts" WHERE "posts"."id" = ?[0m [["id", 1]]
|
22916
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
22917
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
22918
|
+
[1m[35m (0.0ms)[0m begin transaction
|
22919
|
+
--------------------------
|
22920
|
+
ListsTest: test_build_list
|
22921
|
+
--------------------------
|
22922
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
22923
|
+
[1m[35m (0.1ms)[0m begin transaction
|
22924
|
+
---------------------------
|
22925
|
+
ListsTest: test_create_list
|
22926
|
+
---------------------------
|
22927
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
22928
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "users" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "name"], ["created_at", "2015-02-15 23:27:45.583403"], ["updated_at", "2015-02-15 23:27:45.583403"]]
|
22929
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
22930
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
22931
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "users" ("name", "created_at", "updated_at") VALUES (?, ?, ?)[0m [["name", "name"], ["created_at", "2015-02-15 23:27:45.585197"], ["updated_at", "2015-02-15 23:27:45.585197"]]
|
22932
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
22933
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
22934
|
+
[1m[35mSQL (0.0ms)[0m INSERT INTO "users" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "name"], ["created_at", "2015-02-15 23:27:45.586688"], ["updated_at", "2015-02-15 23:27:45.586688"]]
|
22935
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
22936
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
22937
|
+
[1m[36mSQL (0.0ms)[0m [1mDELETE FROM "users" WHERE "users"."id" = ?[0m [["id", 3]]
|
22938
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
22939
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
22940
|
+
[1m[35mSQL (0.0ms)[0m DELETE FROM "users" WHERE "users"."id" = ? [["id", 2]]
|
22941
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
22942
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
22943
|
+
[1m[36mSQL (0.0ms)[0m [1mDELETE FROM "users" WHERE "users"."id" = ?[0m [["id", 1]]
|
22944
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
22945
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
22946
|
+
[1m[35m (0.0ms)[0m begin transaction
|
22947
|
+
------------------------------------
|
22948
|
+
FabricatorsTest: test_build_instance
|
22949
|
+
------------------------------------
|
22950
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
22951
|
+
[1m[35m (0.0ms)[0m begin transaction
|
22952
|
+
-------------------------------------
|
22953
|
+
FabricatorsTest: test_create_instance
|
22954
|
+
-------------------------------------
|
22955
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
22956
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "users" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "name"], ["created_at", "2015-02-15 23:27:45.592028"], ["updated_at", "2015-02-15 23:27:45.592028"]]
|
22957
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
22958
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
22959
|
+
[1m[36mSQL (0.0ms)[0m [1mDELETE FROM "users" WHERE "users"."id" = ?[0m [["id", 1]]
|
22960
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
22961
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
22962
|
+
[1m[35m (0.0ms)[0m begin transaction
|
22963
|
+
---------------------------------------
|
22964
|
+
FabricatorsTest: test_return_attributes
|
22965
|
+
---------------------------------------
|
22966
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
22967
|
+
[1m[35m (0.0ms)[0m begin transaction
|
22968
|
+
-------------------------
|
22969
|
+
LoadTest: test_find_files
|
22970
|
+
-------------------------
|
22971
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
22972
|
+
[1m[35m (0.1ms)[0m begin transaction
|
22973
|
+
------------------------------------
|
22974
|
+
InheritanceTest: test_build_instance
|
22975
|
+
------------------------------------
|
22976
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
22977
|
+
[1m[35m (0.0ms)[0m begin transaction
|
22978
|
+
-------------------------------------
|
22979
|
+
InheritanceTest: test_create_instance
|
22980
|
+
-------------------------------------
|
22981
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
22982
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "users" ("name", "age", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "name"], ["age", 9], ["created_at", "2015-02-15 23:27:45.599234"], ["updated_at", "2015-02-15 23:27:45.599234"]]
|
22983
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
22984
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
22985
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "users" ("name", "email", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["name", "name"], ["email", "mail@example.com"], ["created_at", "2015-02-15 23:27:45.600968"], ["updated_at", "2015-02-15 23:27:45.600968"]]
|
22986
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
22987
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
22988
|
+
[1m[35mSQL (0.0ms)[0m DELETE FROM "users" WHERE "users"."id" = ? [["id", 2]]
|
22989
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
22990
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
22991
|
+
[1m[36mSQL (0.0ms)[0m [1mDELETE FROM "users" WHERE "users"."id" = ?[0m [["id", 1]]
|
22992
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
22993
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
22994
|
+
[1m[35m (0.0ms)[0m begin transaction
|
22995
|
+
---------------------------------------
|
22996
|
+
InheritanceTest: test_return_attributes
|
22997
|
+
---------------------------------------
|
22998
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
22999
|
+
[1m[35m (0.1ms)[0m begin transaction
|
23000
|
+
----------------------------------
|
23001
|
+
DependentTest: test_build_instance
|
23002
|
+
----------------------------------
|
23003
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
23004
|
+
[1m[35m (0.0ms)[0m begin transaction
|
23005
|
+
-------------------------------------
|
23006
|
+
DependentTest: test_return_attributes
|
23007
|
+
-------------------------------------
|
23008
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
23009
|
+
[1m[35m (0.0ms)[0m begin transaction
|
23010
|
+
-----------------------------------
|
23011
|
+
DependentTest: test_create_instance
|
23012
|
+
-----------------------------------
|
23013
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
23014
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "users" ("name", "email", "username", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["name", "name"], ["email", "name@example.com"], ["username", "name-1"], ["created_at", "2015-02-15 23:27:45.607537"], ["updated_at", "2015-02-15 23:27:45.607537"]]
|
23015
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
23016
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
23017
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "users" ("name", "email", "username", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["name", "name"], ["email", "name@example.com"], ["username", "name-2"], ["created_at", "2015-02-15 23:27:45.609223"], ["updated_at", "2015-02-15 23:27:45.609223"]]
|
23018
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
23019
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
23020
|
+
[1m[35mSQL (0.0ms)[0m DELETE FROM "users" WHERE "users"."id" = ? [["id", 2]]
|
23021
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
23022
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
23023
|
+
[1m[36mSQL (0.0ms)[0m [1mDELETE FROM "users" WHERE "users"."id" = ?[0m [["id", 1]]
|
23024
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
23025
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
23026
|
+
[1m[35m (0.0ms)[0m begin transaction
|
23027
|
+
-------------------------
|
23028
|
+
AliasesTest: test_aliases
|
23029
|
+
-------------------------
|
23030
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
23031
|
+
[1m[35m (0.1ms)[0m begin transaction
|
23032
|
+
------------------------------------
|
23033
|
+
GeneratorsTest: test_file_generation
|
23034
|
+
------------------------------------
|
23035
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
23036
|
+
[1m[35m (0.1ms)[0m begin transaction
|
23037
|
+
-----------------------------
|
23038
|
+
CleanTest: test_clean_records
|
23039
|
+
-----------------------------
|
23040
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
23041
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-02-15 23:27:45.616734"], ["updated_at", "2015-02-15 23:27:45.616734"]]
|
23042
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
23043
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
23044
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?)[0m [["created_at", "2015-02-15 23:27:45.618257"], ["updated_at", "2015-02-15 23:27:45.618257"]]
|
23045
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
23046
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
23047
|
+
[1m[35mSQL (0.0ms)[0m INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-02-15 23:27:45.619570"], ["updated_at", "2015-02-15 23:27:45.619570"]]
|
23048
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
23049
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
23050
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?)[0m [["created_at", "2015-02-15 23:27:45.620767"], ["updated_at", "2015-02-15 23:27:45.620767"]]
|
23051
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
23052
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
23053
|
+
[1m[35mSQL (0.0ms)[0m INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-02-15 23:27:45.621917"], ["updated_at", "2015-02-15 23:27:45.621917"]]
|
23054
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
23055
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
23056
|
+
[1m[36mSQL (0.0ms)[0m [1mDELETE FROM "users" WHERE "users"."id" = ?[0m [["id", 5]]
|
23057
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
23058
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
23059
|
+
[1m[35mSQL (0.0ms)[0m DELETE FROM "users" WHERE "users"."id" = ? [["id", 4]]
|
23060
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
23061
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
23062
|
+
[1m[36mSQL (0.0ms)[0m [1mDELETE FROM "users" WHERE "users"."id" = ?[0m [["id", 3]]
|
23063
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
23064
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
23065
|
+
[1m[35mSQL (0.0ms)[0m DELETE FROM "users" WHERE "users"."id" = ? [["id", 2]]
|
23066
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
23067
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
23068
|
+
[1m[36mSQL (0.0ms)[0m [1mDELETE FROM "users" WHERE "users"."id" = ?[0m [["id", 1]]
|
23069
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
23070
|
+
[1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "users"[0m
|
23071
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
23072
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
23073
|
+
-------------------------------------
|
23074
|
+
AttributesTest: test_numeric_sequence
|
23075
|
+
-------------------------------------
|
23076
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
23077
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "users" ("email", "age", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["email", "mail3@example.com"], ["age", 3], ["created_at", "2015-02-15 23:27:45.637074"], ["updated_at", "2015-02-15 23:27:45.637074"]]
|
23078
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
23079
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
23080
|
+
[1m[35mSQL (0.0ms)[0m DELETE FROM "users" WHERE "users"."id" = ? [["id", 1]]
|
23081
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
23082
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
23083
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
23084
|
+
-----------------------------------
|
23085
|
+
AttributesTest: test_block_sequence
|
23086
|
+
-----------------------------------
|
23087
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
23088
|
+
[1m[36mSQL (0.0ms)[0m [1mINSERT INTO "users" ("email", "age", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["email", "mail3@example.com"], ["age", 3], ["created_at", "2015-02-15 23:27:45.640129"], ["updated_at", "2015-02-15 23:27:45.640129"]]
|
23089
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
23090
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
23091
|
+
[1m[35mSQL (0.0ms)[0m DELETE FROM "users" WHERE "users"."id" = ? [["id", 1]]
|
23092
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
23093
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
data/test/fabricators_test.rb
CHANGED
@@ -10,20 +10,20 @@ class FabricatorsTest < ActiveSupport::TestCase
|
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
|
-
test
|
13
|
+
test 'return attributes' do
|
14
14
|
hash = attributes_for(:user)
|
15
15
|
assert_kind_of Hash, hash
|
16
16
|
assert_equal 'name', hash[:name]
|
17
17
|
end
|
18
18
|
|
19
|
-
test
|
19
|
+
test 'build instance' do
|
20
20
|
record = build(:user)
|
21
21
|
assert_kind_of User, record
|
22
22
|
assert record.new_record?
|
23
23
|
assert_equal 'name', record.name
|
24
24
|
end
|
25
25
|
|
26
|
-
test
|
26
|
+
test 'create instance' do
|
27
27
|
record = create(:user)
|
28
28
|
assert_kind_of User, record
|
29
29
|
assert record.persisted?
|
data/test/generators_test.rb
CHANGED
data/test/inheritance_test.rb
CHANGED
@@ -16,7 +16,7 @@ class InheritanceTest < ActiveSupport::TestCase
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
-
test
|
19
|
+
test 'return attributes' do
|
20
20
|
user_with_age = attributes_for(:user_with_age)
|
21
21
|
assert_equal 'name', user_with_age[:name]
|
22
22
|
assert_equal 9, user_with_age[:age]
|
@@ -26,7 +26,7 @@ class InheritanceTest < ActiveSupport::TestCase
|
|
26
26
|
assert_equal 'mail@example.com', user_with_email[:email]
|
27
27
|
end
|
28
28
|
|
29
|
-
test
|
29
|
+
test 'build instance' do
|
30
30
|
user_with_age = build(:user_with_age)
|
31
31
|
assert_equal 'name', user_with_age.name
|
32
32
|
assert_equal 9, user_with_age.age
|
@@ -36,7 +36,7 @@ class InheritanceTest < ActiveSupport::TestCase
|
|
36
36
|
assert_equal 'mail@example.com', user_with_email.email
|
37
37
|
end
|
38
38
|
|
39
|
-
test
|
39
|
+
test 'create instance' do
|
40
40
|
user_with_age = create(:user_with_age)
|
41
41
|
assert_equal 'name', user_with_age.name
|
42
42
|
assert_equal 9, user_with_age.age
|
data/test/lists_test.rb
CHANGED
@@ -10,7 +10,7 @@ class ListsTest < ActiveSupport::TestCase
|
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
|
-
test
|
13
|
+
test 'build list' do
|
14
14
|
list = build(:user, 3)
|
15
15
|
assert_equal 3, list.size
|
16
16
|
list.each do |user|
|
@@ -20,7 +20,7 @@ class ListsTest < ActiveSupport::TestCase
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
-
test
|
23
|
+
test 'create list' do
|
24
24
|
list = create(:user, 3)
|
25
25
|
assert_equal 3, list.size
|
26
26
|
list.each do |user|
|
data/test/load_test.rb
CHANGED
data/test/merges_test.rb
CHANGED
@@ -10,18 +10,18 @@ class MergesTest < ActiveSupport::TestCase
|
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
|
-
test
|
13
|
+
test 'return attributes' do
|
14
14
|
assert_equal 'other', attributes_for(:user, name: 'other')[:name]
|
15
15
|
end
|
16
16
|
|
17
|
-
test
|
17
|
+
test 'build instance' do
|
18
18
|
assert_equal 'other', build(:user, name: 'other').name
|
19
19
|
build(:user, 3, name: 'other').each do |user|
|
20
20
|
assert_equal 'other', user.name
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
-
test
|
24
|
+
test 'create instance' do
|
25
25
|
assert_equal 'other', create(:user, name: 'other').name
|
26
26
|
create(:user, 3, name: 'other').each do |user|
|
27
27
|
assert_equal 'other', user.name
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fabricators
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Museways
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-02-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -16,8 +16,8 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
20
|
-
- - "
|
19
|
+
version: 4.0.0
|
20
|
+
- - "<="
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: 4.2.0
|
23
23
|
type: :runtime
|
@@ -26,8 +26,8 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
30
|
-
- - "
|
29
|
+
version: 4.0.0
|
30
|
+
- - "<="
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 4.2.0
|
33
33
|
- !ruby/object:Gem::Dependency
|
@@ -52,7 +52,7 @@ extensions: []
|
|
52
52
|
extra_rdoc_files: []
|
53
53
|
files:
|
54
54
|
- MIT-LICENSE
|
55
|
-
- README.
|
55
|
+
- README.md
|
56
56
|
- Rakefile
|
57
57
|
- lib/fabricators.rb
|
58
58
|
- lib/fabricators/callbacks.rb
|
@@ -142,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
142
142
|
version: '0'
|
143
143
|
requirements: []
|
144
144
|
rubyforge_project:
|
145
|
-
rubygems_version: 2.
|
145
|
+
rubygems_version: 2.4.5
|
146
146
|
signing_key:
|
147
147
|
specification_version: 4
|
148
148
|
summary: Fabricators for Rails
|
data/README.rdoc
DELETED
@@ -1,127 +0,0 @@
|
|
1
|
-
=== NOTE: Important changes in version 0.1.0, read below.
|
2
|
-
|
3
|
-
---
|
4
|
-
|
5
|
-
{<img src="https://badge.fury.io/rb/fabricators.png" alt="Gem Version" />}[http://badge.fury.io/rb/fabricators] {<img src="https://codeclimate.com/github/museways/fabricators.png" />}[https://codeclimate.com/github/museways/fabricators] {<img src="https://travis-ci.org/museways/fabricators.png?branch=master" alt="Build Status" />}[https://travis-ci.org/museways/fabricators]
|
6
|
-
|
7
|
-
= Fabricators
|
8
|
-
|
9
|
-
Minimalistic factory inspired in factory_girl for rails.
|
10
|
-
|
11
|
-
= Install
|
12
|
-
|
13
|
-
Put this line in your Gemfile:
|
14
|
-
gem 'fabricators', group: [:development, :test]
|
15
|
-
|
16
|
-
Then bundle:
|
17
|
-
$ bundle
|
18
|
-
|
19
|
-
= Configuration
|
20
|
-
|
21
|
-
There is no need to configure anything, all this is done automatically for rspec and minitest:
|
22
|
-
|
23
|
-
- Loading the definitions.
|
24
|
-
- Replacing the fixtures generators.
|
25
|
-
- Including the methods inside your testing framework.
|
26
|
-
- Cleaning the database after each test.
|
27
|
-
|
28
|
-
= Usage
|
29
|
-
|
30
|
-
== Methods
|
31
|
-
|
32
|
-
There are three methods available:
|
33
|
-
attributes_for
|
34
|
-
build
|
35
|
-
create
|
36
|
-
|
37
|
-
Is possible to override the defaults passing a hash:
|
38
|
-
build :user, name: 'other'
|
39
|
-
create :category, title: 'other'
|
40
|
-
|
41
|
-
To create lists just pass the desired size as second parameter to build and create methods:
|
42
|
-
build :user, 2, name: 'other'
|
43
|
-
create :category, 5, title: 'other'
|
44
|
-
|
45
|
-
== Fabricators
|
46
|
-
|
47
|
-
Define them in a ruby file inside test/fabricators or spec/fabricators folders:
|
48
|
-
fabricator :user do
|
49
|
-
name 'example'
|
50
|
-
end
|
51
|
-
|
52
|
-
== Inheritance
|
53
|
-
|
54
|
-
Can be declare nested or separated:
|
55
|
-
fabricator :user do
|
56
|
-
name 'example'
|
57
|
-
fabricator :user_with_email do
|
58
|
-
email 'example@mail.com'
|
59
|
-
end
|
60
|
-
end
|
61
|
-
fabricator :user_with_age, parent: :user do
|
62
|
-
age 9
|
63
|
-
end
|
64
|
-
|
65
|
-
== Sequences
|
66
|
-
|
67
|
-
Generates an unique sequence of numbers for the attribute of the fabricator:
|
68
|
-
fabricator :user do
|
69
|
-
sequence(:email) { |n| "example#{n}@mail.com" }
|
70
|
-
sequence(:age)
|
71
|
-
end
|
72
|
-
|
73
|
-
== Associations
|
74
|
-
|
75
|
-
Associations are used by name:
|
76
|
-
fabricator :user do
|
77
|
-
posts
|
78
|
-
comments 4 # You can customize the number of records
|
79
|
-
end
|
80
|
-
fabricator :post do
|
81
|
-
user
|
82
|
-
end
|
83
|
-
fabricator :comment do
|
84
|
-
user
|
85
|
-
end
|
86
|
-
|
87
|
-
== Aliases
|
88
|
-
|
89
|
-
The aliases are important when there is the need of context:
|
90
|
-
fabricators :user, aliases: :author do
|
91
|
-
comments
|
92
|
-
end
|
93
|
-
fabricators :post, aliases: :comment do
|
94
|
-
title
|
95
|
-
author
|
96
|
-
end
|
97
|
-
|
98
|
-
== Dependent attributes
|
99
|
-
|
100
|
-
If you need to use some logic that depends of another attribute you can use a block or sequence:
|
101
|
-
fabricators :user do
|
102
|
-
name 'example'
|
103
|
-
email { "#{name}@mail.com" }
|
104
|
-
sequence(:username) { |n| "#{name}-#{n}" }
|
105
|
-
end
|
106
|
-
|
107
|
-
== Callbacks
|
108
|
-
|
109
|
-
The available callbacks are before(:build), before(:create), after(:build) and after(:create):
|
110
|
-
fabricator :user do
|
111
|
-
after(:build) { |u| u.name = 'sample' }
|
112
|
-
end
|
113
|
-
|
114
|
-
You can declare global callbacks in your test or spec helper as well:
|
115
|
-
Fabricators.configure do
|
116
|
-
after(:create) do |object|
|
117
|
-
log object.errors unless object.valid?
|
118
|
-
end
|
119
|
-
end
|
120
|
-
|
121
|
-
= Credits
|
122
|
-
|
123
|
-
This gem is maintained and funded by museways[http://museways.com].
|
124
|
-
|
125
|
-
= License
|
126
|
-
|
127
|
-
It is free software, and may be redistributed under the terms specified in the MIT-LICENSE file.
|