factory_girl-preload 2.2.0 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +20 -20
- data/factory_girl-preload.gemspec +1 -2
- data/lib/factory_girl/preload.rb +6 -2
- data/lib/factory_girl/preload/version.rb +1 -1
- data/spec/factory_girl/preload_spec.rb +8 -0
- data/spec/spec_helper.rb +3 -5
- data/spec/support/factories.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 58ac6a913e3b86ef7e1095e07ce9e29b28333f41
|
4
|
+
data.tar.gz: 69fcbba46af74f561ad737413c5e815bd40ef054
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3cc6c33b45a5cb489baebfbb2e4a23b5ea00c144727ccc7a5bfe3dc296de27077debcefa02386fead23fe30dd78d85ba90d35c7e50bdbd84e75ba2abe6f61feb
|
7
|
+
data.tar.gz: dd0c58ba266d546fb254798a32bfc383c082bbbc6195d007eabe2e4476261c4d0bfe826569e995a66b5bf2ca68647ed905727ccba98502935df07b59e8eae253
|
data/Gemfile.lock
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
factory_girl-preload (2.
|
5
|
-
factory_girl (>=
|
4
|
+
factory_girl-preload (2.3.0)
|
5
|
+
factory_girl (>= 4.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
actionpack (4.1.
|
11
|
-
actionview (= 4.1.
|
12
|
-
activesupport (= 4.1.
|
10
|
+
actionpack (4.1.4)
|
11
|
+
actionview (= 4.1.4)
|
12
|
+
activesupport (= 4.1.4)
|
13
13
|
rack (~> 1.5.2)
|
14
14
|
rack-test (~> 0.6.2)
|
15
|
-
actionview (4.1.
|
16
|
-
activesupport (= 4.1.
|
15
|
+
actionview (4.1.4)
|
16
|
+
activesupport (= 4.1.4)
|
17
17
|
builder (~> 3.1)
|
18
18
|
erubis (~> 2.7.0)
|
19
|
-
activemodel (4.1.
|
20
|
-
activesupport (= 4.1.
|
19
|
+
activemodel (4.1.4)
|
20
|
+
activesupport (= 4.1.4)
|
21
21
|
builder (~> 3.1)
|
22
|
-
activerecord (4.1.
|
23
|
-
activemodel (= 4.1.
|
24
|
-
activesupport (= 4.1.
|
22
|
+
activerecord (4.1.4)
|
23
|
+
activemodel (= 4.1.4)
|
24
|
+
activesupport (= 4.1.4)
|
25
25
|
arel (~> 5.0.0)
|
26
|
-
activesupport (4.1.
|
26
|
+
activesupport (4.1.4)
|
27
27
|
i18n (~> 0.6, >= 0.6.9)
|
28
28
|
json (~> 1.7, >= 1.7.7)
|
29
29
|
minitest (~> 5.1)
|
@@ -37,16 +37,16 @@ GEM
|
|
37
37
|
erubis (2.7.0)
|
38
38
|
factory_girl (4.4.0)
|
39
39
|
activesupport (>= 3.0.0)
|
40
|
-
i18n (0.6.
|
40
|
+
i18n (0.6.11)
|
41
41
|
json (1.8.1)
|
42
42
|
method_source (0.8.2)
|
43
|
-
minitest (5.
|
43
|
+
minitest (5.4.0)
|
44
44
|
mysql2 (0.3.16)
|
45
45
|
pry (0.9.12.6)
|
46
46
|
coderay (~> 1.0)
|
47
47
|
method_source (~> 0.8)
|
48
48
|
slop (~> 3.4)
|
49
|
-
pry-meta (0.0.
|
49
|
+
pry-meta (0.0.9)
|
50
50
|
awesome_print
|
51
51
|
pry
|
52
52
|
pry-nav
|
@@ -59,9 +59,9 @@ GEM
|
|
59
59
|
rack (1.5.2)
|
60
60
|
rack-test (0.6.2)
|
61
61
|
rack (>= 1.0)
|
62
|
-
railties (4.1.
|
63
|
-
actionpack (= 4.1.
|
64
|
-
activesupport (= 4.1.
|
62
|
+
railties (4.1.4)
|
63
|
+
actionpack (= 4.1.4)
|
64
|
+
activesupport (= 4.1.4)
|
65
65
|
rake (>= 0.8.7)
|
66
66
|
thor (>= 0.18.1, < 2.0)
|
67
67
|
rake (10.3.2)
|
@@ -81,7 +81,7 @@ GEM
|
|
81
81
|
rspec-mocks (~> 3.0.0)
|
82
82
|
rspec-support (~> 3.0.0)
|
83
83
|
rspec-support (3.0.2)
|
84
|
-
slop (3.
|
84
|
+
slop (3.6.0)
|
85
85
|
thor (0.19.1)
|
86
86
|
thread_safe (0.3.4)
|
87
87
|
tzinfo (1.2.1)
|
@@ -1,4 +1,3 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
1
|
$:.push File.expand_path("../lib", __FILE__)
|
3
2
|
require "factory_girl/preload/version"
|
4
3
|
|
@@ -17,7 +16,7 @@ Gem::Specification.new do |s|
|
|
17
16
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
18
17
|
s.require_paths = ["lib"]
|
19
18
|
|
20
|
-
s.add_dependency "factory_girl", ">=
|
19
|
+
s.add_dependency "factory_girl", ">= 4.0"
|
21
20
|
s.add_development_dependency "activerecord"
|
22
21
|
s.add_development_dependency "actionpack"
|
23
22
|
s.add_development_dependency "rspec-rails"
|
data/lib/factory_girl/preload.rb
CHANGED
@@ -1,11 +1,15 @@
|
|
1
|
+
require "factory_girl"
|
2
|
+
|
1
3
|
module FactoryGirl
|
2
4
|
module Preload
|
3
|
-
|
4
|
-
|
5
|
+
require "factory_girl/preload/helpers"
|
6
|
+
require "factory_girl/preload/version"
|
5
7
|
|
6
8
|
require "factory_girl/preload/rspec2" if defined?(RSpec)
|
7
9
|
require "factory_girl/preload/extension"
|
8
10
|
|
11
|
+
::FactoryGirl::SyntaxRunner.send(:include, Helpers)
|
12
|
+
|
9
13
|
class << self
|
10
14
|
attr_accessor :preloaders
|
11
15
|
attr_accessor :factories
|
@@ -45,6 +45,10 @@ describe FactoryGirl::Preload do
|
|
45
45
|
expect { FactoryGirl::Preload.clean }.to raise_error(%[Couldn't find invalid clean type])
|
46
46
|
end
|
47
47
|
|
48
|
+
example "association uses preloaded record" do
|
49
|
+
expect(build(:skill).user).to eq(users(:john))
|
50
|
+
end
|
51
|
+
|
48
52
|
context "removes records" do
|
49
53
|
it "with deletion" do
|
50
54
|
expect(User.count).to eq(1)
|
@@ -91,4 +95,8 @@ describe FactoryGirl::Preload do
|
|
91
95
|
it "includes factory girl helpers" do
|
92
96
|
expect(self.class.included_modules).to include(FactoryGirl::Syntax::Methods)
|
93
97
|
end
|
98
|
+
|
99
|
+
it "includes helpers into factory girl" do
|
100
|
+
expect(FactoryGirl::SyntaxRunner.included_modules).to include(FactoryGirl::Preload::Helpers)
|
101
|
+
end
|
94
102
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -2,21 +2,17 @@ ENV["RAILS_ENV"] = "test"
|
|
2
2
|
require "rails"
|
3
3
|
|
4
4
|
ENV["BUNDLE_GEMFILE"] = File.dirname(__FILE__) + "/../Gemfile"
|
5
|
-
require "bundler"
|
6
|
-
Bundler.setup
|
5
|
+
require "bundler/setup"
|
7
6
|
require "rails/all"
|
8
|
-
Bundler.require(:default)
|
9
7
|
|
10
8
|
require "rspec/rails"
|
11
9
|
require "factory_girl"
|
12
|
-
require File.dirname(__FILE__) + "/support/factories"
|
13
10
|
|
14
11
|
module RSpec
|
15
12
|
class Application < ::Rails::Application
|
16
13
|
config.root = File.dirname(__FILE__) + "/support/app"
|
17
14
|
config.active_support.deprecation = :log
|
18
15
|
config.eager_load = false
|
19
|
-
# config.active_record.logger = Logger.new(STDOUT)
|
20
16
|
end
|
21
17
|
end
|
22
18
|
|
@@ -27,4 +23,6 @@ RSpec.configure do |config|
|
|
27
23
|
config.use_transactional_fixtures = true
|
28
24
|
end
|
29
25
|
|
26
|
+
require "factory_girl/preload"
|
27
|
+
require File.dirname(__FILE__) + "/support/factories"
|
30
28
|
FactoryGirl::Preload.run
|
data/spec/support/factories.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: factory_girl-preload
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nando Vieira
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: factory_girl
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '4.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '4.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: activerecord
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|