solidus_dev_support 2.4.0 → 2.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +19 -2
- data/lib/solidus_dev_support/testing_support/factories.rb +31 -7
- data/lib/solidus_dev_support/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d8b89b3a9856d2e920d23a4aa6b111f5d0183ac78c6a4148b1eb41627277bc5a
|
4
|
+
data.tar.gz: b5ba6eda194e217eb30e965a278f69cf3a0ecd09d3c1b589e66cfbe4bdb49ad5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 778ebb59f1f980c9a978fb353c3ba68b4e89bdafe1b0f2d4509108fcac286f08e9e7c1923db706ff809f4bea47df6359dfa82c012b8061dcfabc9f0afd5701c1
|
7
|
+
data.tar.gz: f1de5819cdd6f252490fa1ee458765b1a47dd1a82f46e92b5b7b027fe80682b6955144aaa7491f4bf56cae910133431a2fa7dc842365d9b69170b251d2a8fe3c
|
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,25 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
-
## [
|
3
|
+
## [v2.4.0](https://github.com/solidusio/solidus_dev_support/tree/v2.4.0) (2021-02-05)
|
4
4
|
|
5
|
-
[Full Changelog](https://github.com/solidusio/solidus_dev_support/compare/v2.
|
5
|
+
[Full Changelog](https://github.com/solidusio/solidus_dev_support/compare/v2.3.0...v2.4.0)
|
6
|
+
|
7
|
+
**Implemented enhancements:**
|
8
|
+
|
9
|
+
- Improve engine's requires to remove double inclusions [\#165](https://github.com/solidusio/solidus_dev_support/pull/165) ([kennyadsl](https://github.com/kennyadsl))
|
10
|
+
- Remove double require of core factories from rails\_helper [\#164](https://github.com/solidusio/solidus_dev_support/pull/164) ([kennyadsl](https://github.com/kennyadsl))
|
11
|
+
|
12
|
+
**Fixed bugs:**
|
13
|
+
|
14
|
+
- Fix typo in configuration.rb.tt [\#166](https://github.com/solidusio/solidus_dev_support/pull/166) ([brchristian](https://github.com/brchristian))
|
15
|
+
|
16
|
+
**Merged pull requests:**
|
17
|
+
|
18
|
+
- Rename spree:install to solidus:install in the sandbox template [\#167](https://github.com/solidusio/solidus_dev_support/pull/167) ([blocknotes](https://github.com/blocknotes))
|
19
|
+
|
20
|
+
## [v2.3.0](https://github.com/solidusio/solidus_dev_support/tree/v2.3.0) (2021-01-14)
|
21
|
+
|
22
|
+
[Full Changelog](https://github.com/solidusio/solidus_dev_support/compare/v2.2.0...v2.3.0)
|
6
23
|
|
7
24
|
**Implemented enhancements:**
|
8
25
|
|
@@ -1,20 +1,39 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
require 'factory_bot'
|
3
|
+
begin
|
4
|
+
require 'spree/testing_support/factory_bot'
|
5
|
+
rescue LoadError
|
6
|
+
require 'factory_bot'
|
7
|
+
require 'spree/testing_support/factories'
|
8
|
+
end
|
5
9
|
|
6
10
|
module SolidusDevSupport
|
7
11
|
module TestingSupport
|
8
12
|
module Factories
|
9
13
|
def self.load_for(*engines)
|
10
14
|
paths = engines.flat_map do |engine|
|
11
|
-
engine.root.glob('lib
|
15
|
+
factories_file_or_folder = engine.root.glob('lib/*/testing_support/factories{,.rb}')
|
16
|
+
|
17
|
+
if factories_file_or_folder.size == 2 && using_factory_bot_definition_file_paths?
|
18
|
+
folder, file = factories_file_or_folder.partition(&:directory?).map(&:first).map { |path| path.to_s.gsub(engine.root.to_s, '') }
|
19
|
+
ActiveSupport::Deprecation.warn <<-WARN.squish, caller(4)
|
20
|
+
SolidusDevSupport::TestingSupport::Factories.load_for() is automatically loading
|
21
|
+
all factories present into #{folder}. You should now safely remove #{file} if it
|
22
|
+
is only used to load ./factories content.
|
23
|
+
WARN
|
24
|
+
|
25
|
+
engine.root.glob('lib/*/testing_support/factories/**/*_factory.rb')
|
26
|
+
else
|
27
|
+
factories_file_or_folder
|
28
|
+
end.map { |path| path.sub(/.rb\z/, '').to_s }
|
12
29
|
end
|
13
30
|
|
14
|
-
if
|
15
|
-
FactoryBot.definition_file_paths
|
16
|
-
|
17
|
-
|
31
|
+
if using_factory_bot_definition_file_paths?
|
32
|
+
FactoryBot.definition_file_paths = [
|
33
|
+
Spree::TestingSupport::FactoryBot.definition_file_paths,
|
34
|
+
paths,
|
35
|
+
].flatten
|
36
|
+
|
18
37
|
FactoryBot.reload
|
19
38
|
else
|
20
39
|
FactoryBot.find_definitions
|
@@ -22,6 +41,11 @@ module SolidusDevSupport
|
|
22
41
|
paths.each { |path| require path }
|
23
42
|
end
|
24
43
|
end
|
44
|
+
|
45
|
+
def self.using_factory_bot_definition_file_paths?
|
46
|
+
defined?(Spree::TestingSupport::FactoryBot) &&
|
47
|
+
Spree::TestingSupport::FactoryBot.respond_to?(:definition_file_paths)
|
48
|
+
end
|
25
49
|
end
|
26
50
|
end
|
27
51
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solidus_dev_support
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alessandro Desantis
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-02-
|
11
|
+
date: 2021-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capybara
|