activeinteractor 1.2.0 → 1.2.2
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 +4 -4
- data/CHANGELOG.md +24 -3
- data/lib/active_interactor/interactor/worker.rb +7 -1
- data/lib/active_interactor/organizer/perform.rb +8 -9
- data/lib/active_interactor/version.rb +1 -1
- metadata +8 -128
- data/spec/active_interactor/base_spec.rb +0 -85
- data/spec/active_interactor/config_spec.rb +0 -17
- data/spec/active_interactor/context/base_spec.rb +0 -443
- data/spec/active_interactor/error_spec.rb +0 -45
- data/spec/active_interactor/interactor/perform/options_spec.rb +0 -25
- data/spec/active_interactor/interactor/worker_spec.rb +0 -189
- data/spec/active_interactor/organizer/base_spec.rb +0 -276
- data/spec/active_interactor/organizer/interactor_interface_collection_spec.rb +0 -78
- data/spec/active_interactor/organizer/interactor_interface_spec.rb +0 -235
- data/spec/active_interactor/version_spec.rb +0 -119
- data/spec/active_interactor_spec.rb +0 -23
- data/spec/integration/a_basic_interactor_spec.rb +0 -154
- data/spec/integration/a_basic_organizer_spec.rb +0 -354
- data/spec/integration/a_failing_interactor_spec.rb +0 -43
- data/spec/integration/active_record_integration_spec.rb +0 -32
- data/spec/integration/an_interactor_with_after_context_validation_callbacks_spec.rb +0 -69
- data/spec/integration/an_interactor_with_after_perform_callbacks_spec.rb +0 -31
- data/spec/integration/an_interactor_with_after_rollback_callbacks_spec.rb +0 -34
- data/spec/integration/an_interactor_with_an_existing_context_class_spec.rb +0 -50
- data/spec/integration/an_interactor_with_around_perform_callbacks_spec.rb +0 -35
- data/spec/integration/an_interactor_with_around_rollback_callbacks_spec.rb +0 -39
- data/spec/integration/an_interactor_with_before_perform_callbacks_spec.rb +0 -31
- data/spec/integration/an_interactor_with_before_rollback_callbacks_spec.rb +0 -34
- data/spec/integration/an_interactor_with_deferred_after_callbacks.rb +0 -32
- data/spec/integration/an_interactor_with_validations_on_called_spec.rb +0 -41
- data/spec/integration/an_interactor_with_validations_on_calling_spec.rb +0 -37
- data/spec/integration/an_interactor_with_validations_spec.rb +0 -95
- data/spec/integration/an_organizer_containing_organizer_with_after_callbacks_deferred_spec.rb +0 -125
- data/spec/integration/an_organizer_performing_in_parallel_spec.rb +0 -48
- data/spec/integration/an_organizer_with_after_callbacks_deferred_spec.rb +0 -154
- data/spec/integration/an_organizer_with_after_each_callbacks_spec.rb +0 -35
- data/spec/integration/an_organizer_with_all_perform_callbacks.rb +0 -112
- data/spec/integration/an_organizer_with_around_each_callbacks_spec.rb +0 -39
- data/spec/integration/an_organizer_with_before_each_callbacks_spec.rb +0 -35
- data/spec/integration/an_organizer_with_conditionally_organized_interactors_spec.rb +0 -326
- data/spec/integration/an_organizer_with_failing_nested_organizer_spec.rb +0 -47
- data/spec/integration/an_organizer_with_options_callbacks_spec.rb +0 -64
- data/spec/spec_helper.rb +0 -33
- data/spec/support/coverage.rb +0 -50
- data/spec/support/helpers/factories.rb +0 -49
- data/spec/support/shared_examples/a_class_that_extends_active_interactor_models_example.rb +0 -81
- data/spec/support/shared_examples/a_class_with_interactor_callback_methods_example.rb +0 -107
- data/spec/support/shared_examples/a_class_with_interactor_context_methods_example.rb +0 -60
- data/spec/support/shared_examples/a_class_with_interactor_methods_example.rb +0 -21
- data/spec/support/shared_examples/a_class_with_organizer_callback_methods_example.rb +0 -42
- data/spec/support/spec_helpers.rb +0 -7
- /data/lib/rails/generators/templates/{interactor_text_unit.erb → interactor_test_unit.erb} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 764c2b65284b79d85ff2a20f7c5d9a3c3983dd06a869c7cc961b530ef77a7d28
|
4
|
+
data.tar.gz: 02cdcb760098151105d1b9d1367ee2cefca765353b0ebcd302141dcea009c198
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a87326136160d7d3fe3cbea58b42b42b80206249938d7adf9496f000c260c490c902f32d1dc78983e67e05d1559a190a4738cb73dfa166c7f5deafb9a637547
|
7
|
+
data.tar.gz: cc3789900b6a46067a51944f1d8280455e41b014ceb31b5d9e1819fe2e7836f84e9bc5c79871a4fd72f7ad4d85146cf18b9554dd7f15955c8c0f4d7b017aa20a
|
data/CHANGELOG.md
CHANGED
@@ -7,9 +7,27 @@ and this project adheres to [Semantic Versioning].
|
|
7
7
|
|
8
8
|
## [Unreleased]
|
9
9
|
|
10
|
+
## [v1.2.2] - 2023-09-30
|
11
|
+
|
12
|
+
### Fixed
|
13
|
+
|
14
|
+
- [\#366] Fixes a minor timing issue for when deferred after_perform callbacks are run.
|
15
|
+
|
16
|
+
## [v1.2.1] - 2022-09-26
|
17
|
+
|
18
|
+
### Fixed
|
19
|
+
|
20
|
+
- [\#358] Typo in generator template name
|
21
|
+
|
22
|
+
## [v1.1.7] - 2022-09-26
|
23
|
+
|
24
|
+
### Fixed
|
25
|
+
|
26
|
+
- [\#358] Typo in generator template name
|
27
|
+
|
10
28
|
## [v1.2.0] - 2022-09-08
|
11
29
|
|
12
|
-
|
30
|
+
|
13
31
|
|
14
32
|
- `ActiveInteractor::Base.defer_after_callbacks_when_organized`
|
15
33
|
- `ActiveInteractor::Organizer::Base.after_all_perform`
|
@@ -258,8 +276,11 @@ and this project adheres to [Semantic Versioning].
|
|
258
276
|
|
259
277
|
<!-- versions -->
|
260
278
|
|
261
|
-
[Unreleased]: https://github.com/aaronmallen/activeinteractor/compare/v1.2.
|
262
|
-
[v1.2.
|
279
|
+
[Unreleased]: https://github.com/aaronmallen/activeinteractor/compare/v1.2.2...HEAD
|
280
|
+
[v1.2.2]: https://github.com/aaronmallen/activeinteractor/compare/v1.2.1...v1.2.2
|
281
|
+
[v1.2.1]: https://github.com/aaronmallen/activeinteractor/compare/v1.2.0...v1.2.1
|
282
|
+
[v1.2.0]: https://github.com/aaronmallen/activeinteractor/compare/v1.1.7...v1.2.0
|
283
|
+
[v1.1.7]: https://github.com/aaronmallen/activeinteractor/compare/v1.1.6...v1.1.7
|
263
284
|
[v1.1.6]: https://github.com/aaronmallen/activeinteractor/compare/v1.1.4...v1.1.6
|
264
285
|
[v1.1.4]: https://github.com/aaronmallen/activeinteractor/compare/v1.1.3...v1.1.4
|
265
286
|
[v1.1.3]: https://github.com/aaronmallen/activeinteractor/compare/v1.1.2...v1.1.3
|
@@ -60,10 +60,16 @@ module ActiveInteractor
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def execute_context_with_callbacks!
|
63
|
-
interactor.run_callbacks :perform do
|
63
|
+
result = interactor.run_callbacks :perform do
|
64
64
|
execute_context_with_validation_check!
|
65
65
|
@context = interactor.finalize_context!
|
66
66
|
end
|
67
|
+
|
68
|
+
if context&.success? && interactor.respond_to?(:run_deferred_after_perform_callbacks_on_children)
|
69
|
+
interactor.run_deferred_after_perform_callbacks_on_children
|
70
|
+
end
|
71
|
+
|
72
|
+
result
|
67
73
|
end
|
68
74
|
|
69
75
|
def execute_context_with_validation!
|
@@ -53,7 +53,14 @@ module ActiveInteractor
|
|
53
53
|
perform_in_order
|
54
54
|
end
|
55
55
|
end
|
56
|
-
|
56
|
+
end
|
57
|
+
|
58
|
+
def run_deferred_after_perform_callbacks_on_children
|
59
|
+
self.class.organized.each do |interface|
|
60
|
+
next unless interface.interactor_class.after_callbacks_deferred_when_organized
|
61
|
+
|
62
|
+
context.merge!(interface.execute_deferred_after_perform_callbacks(context))
|
63
|
+
end
|
57
64
|
end
|
58
65
|
|
59
66
|
private
|
@@ -100,14 +107,6 @@ module ActiveInteractor
|
|
100
107
|
end
|
101
108
|
merge_contexts(results.map(&:value))
|
102
109
|
end
|
103
|
-
|
104
|
-
def run_after_perform_callbacks_on_interactors
|
105
|
-
self.class.organized.each do |interface|
|
106
|
-
next unless interface.interactor_class.after_callbacks_deferred_when_organized
|
107
|
-
|
108
|
-
context.merge!(interface.execute_deferred_after_perform_callbacks(context))
|
109
|
-
end
|
110
|
-
end
|
111
110
|
end
|
112
111
|
end
|
113
112
|
end
|
@@ -16,7 +16,7 @@ module ActiveInteractor
|
|
16
16
|
|
17
17
|
# The ActiveInterctor patch version number
|
18
18
|
# @return [Integer] The ActiveInteractor patch version number
|
19
|
-
PATCH =
|
19
|
+
PATCH = 2
|
20
20
|
|
21
21
|
# The ActiveInterctor pre-release version
|
22
22
|
# @return [String | nil] The ActiveInteractor pre-release version
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activeinteractor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Allen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-10-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -64,34 +64,6 @@ dependencies:
|
|
64
64
|
- - "~>"
|
65
65
|
- !ruby/object:Gem::Version
|
66
66
|
version: '2.3'
|
67
|
-
- !ruby/object:Gem::Dependency
|
68
|
-
name: rake
|
69
|
-
requirement: !ruby/object:Gem::Requirement
|
70
|
-
requirements:
|
71
|
-
- - "~>"
|
72
|
-
- !ruby/object:Gem::Version
|
73
|
-
version: '13.0'
|
74
|
-
type: :development
|
75
|
-
prerelease: false
|
76
|
-
version_requirements: !ruby/object:Gem::Requirement
|
77
|
-
requirements:
|
78
|
-
- - "~>"
|
79
|
-
- !ruby/object:Gem::Version
|
80
|
-
version: '13.0'
|
81
|
-
- !ruby/object:Gem::Dependency
|
82
|
-
name: rspec
|
83
|
-
requirement: !ruby/object:Gem::Requirement
|
84
|
-
requirements:
|
85
|
-
- - "~>"
|
86
|
-
- !ruby/object:Gem::Version
|
87
|
-
version: '3.11'
|
88
|
-
type: :development
|
89
|
-
prerelease: false
|
90
|
-
version_requirements: !ruby/object:Gem::Requirement
|
91
|
-
requirements:
|
92
|
-
- - "~>"
|
93
|
-
- !ruby/object:Gem::Version
|
94
|
-
version: '3.11'
|
95
67
|
description: |
|
96
68
|
An implementation of the Command Pattern for Ruby with ActiveModel::Validations inspired by the interactor gem.
|
97
69
|
Rich support for attributes, callbacks, and validations, and thread safe performance methods.
|
@@ -156,63 +128,17 @@ files:
|
|
156
128
|
- lib/rails/generators/templates/context_test_unit.erb
|
157
129
|
- lib/rails/generators/templates/interactor.erb
|
158
130
|
- lib/rails/generators/templates/interactor_spec.erb
|
159
|
-
- lib/rails/generators/templates/
|
131
|
+
- lib/rails/generators/templates/interactor_test_unit.erb
|
160
132
|
- lib/rails/generators/templates/organizer.erb
|
161
|
-
- spec/active_interactor/base_spec.rb
|
162
|
-
- spec/active_interactor/config_spec.rb
|
163
|
-
- spec/active_interactor/context/base_spec.rb
|
164
|
-
- spec/active_interactor/error_spec.rb
|
165
|
-
- spec/active_interactor/interactor/perform/options_spec.rb
|
166
|
-
- spec/active_interactor/interactor/worker_spec.rb
|
167
|
-
- spec/active_interactor/organizer/base_spec.rb
|
168
|
-
- spec/active_interactor/organizer/interactor_interface_collection_spec.rb
|
169
|
-
- spec/active_interactor/organizer/interactor_interface_spec.rb
|
170
|
-
- spec/active_interactor/version_spec.rb
|
171
|
-
- spec/active_interactor_spec.rb
|
172
|
-
- spec/integration/a_basic_interactor_spec.rb
|
173
|
-
- spec/integration/a_basic_organizer_spec.rb
|
174
|
-
- spec/integration/a_failing_interactor_spec.rb
|
175
|
-
- spec/integration/active_record_integration_spec.rb
|
176
|
-
- spec/integration/an_interactor_with_after_context_validation_callbacks_spec.rb
|
177
|
-
- spec/integration/an_interactor_with_after_perform_callbacks_spec.rb
|
178
|
-
- spec/integration/an_interactor_with_after_rollback_callbacks_spec.rb
|
179
|
-
- spec/integration/an_interactor_with_an_existing_context_class_spec.rb
|
180
|
-
- spec/integration/an_interactor_with_around_perform_callbacks_spec.rb
|
181
|
-
- spec/integration/an_interactor_with_around_rollback_callbacks_spec.rb
|
182
|
-
- spec/integration/an_interactor_with_before_perform_callbacks_spec.rb
|
183
|
-
- spec/integration/an_interactor_with_before_rollback_callbacks_spec.rb
|
184
|
-
- spec/integration/an_interactor_with_deferred_after_callbacks.rb
|
185
|
-
- spec/integration/an_interactor_with_validations_on_called_spec.rb
|
186
|
-
- spec/integration/an_interactor_with_validations_on_calling_spec.rb
|
187
|
-
- spec/integration/an_interactor_with_validations_spec.rb
|
188
|
-
- spec/integration/an_organizer_containing_organizer_with_after_callbacks_deferred_spec.rb
|
189
|
-
- spec/integration/an_organizer_performing_in_parallel_spec.rb
|
190
|
-
- spec/integration/an_organizer_with_after_callbacks_deferred_spec.rb
|
191
|
-
- spec/integration/an_organizer_with_after_each_callbacks_spec.rb
|
192
|
-
- spec/integration/an_organizer_with_all_perform_callbacks.rb
|
193
|
-
- spec/integration/an_organizer_with_around_each_callbacks_spec.rb
|
194
|
-
- spec/integration/an_organizer_with_before_each_callbacks_spec.rb
|
195
|
-
- spec/integration/an_organizer_with_conditionally_organized_interactors_spec.rb
|
196
|
-
- spec/integration/an_organizer_with_failing_nested_organizer_spec.rb
|
197
|
-
- spec/integration/an_organizer_with_options_callbacks_spec.rb
|
198
|
-
- spec/spec_helper.rb
|
199
|
-
- spec/support/coverage.rb
|
200
|
-
- spec/support/helpers/factories.rb
|
201
|
-
- spec/support/shared_examples/a_class_that_extends_active_interactor_models_example.rb
|
202
|
-
- spec/support/shared_examples/a_class_with_interactor_callback_methods_example.rb
|
203
|
-
- spec/support/shared_examples/a_class_with_interactor_context_methods_example.rb
|
204
|
-
- spec/support/shared_examples/a_class_with_interactor_methods_example.rb
|
205
|
-
- spec/support/shared_examples/a_class_with_organizer_callback_methods_example.rb
|
206
|
-
- spec/support/spec_helpers.rb
|
207
133
|
homepage: https://github.com/aaronmallen/activeinteractor
|
208
134
|
licenses:
|
209
135
|
- MIT
|
210
136
|
metadata:
|
211
137
|
bug_tracker_uri: https://github.com/aaronmallen/activeinteractor/issues
|
212
|
-
changelog_uri: https://github.com/aaronmallen/activeinteractor/blob/v1.2.
|
213
|
-
documentation_uri: https://www.rubydoc.info/gems/activeinteractor/1.2.
|
138
|
+
changelog_uri: https://github.com/aaronmallen/activeinteractor/blob/v1.2.2/CHANGELOG.md
|
139
|
+
documentation_uri: https://www.rubydoc.info/gems/activeinteractor/1.2.2
|
214
140
|
hompage_uri: https://github.com/aaronmallen/activeinteractor
|
215
|
-
source_code_uri: https://github.com/aaronmallen/activeinteractor/tree/v1.2.
|
141
|
+
source_code_uri: https://github.com/aaronmallen/activeinteractor/tree/v1.2.2
|
216
142
|
wiki_uri: https://github.com/aaronmallen/activeinteractor/wiki
|
217
143
|
post_install_message:
|
218
144
|
rdoc_options: []
|
@@ -229,54 +155,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
229
155
|
- !ruby/object:Gem::Version
|
230
156
|
version: '0'
|
231
157
|
requirements: []
|
232
|
-
rubygems_version: 3.
|
158
|
+
rubygems_version: 3.1.6
|
233
159
|
signing_key:
|
234
160
|
specification_version: 4
|
235
161
|
summary: Ruby interactors with ActiveModel::Validations
|
236
|
-
test_files:
|
237
|
-
- spec/integration/an_interactor_with_deferred_after_callbacks.rb
|
238
|
-
- spec/integration/an_interactor_with_validations_spec.rb
|
239
|
-
- spec/integration/an_organizer_with_after_callbacks_deferred_spec.rb
|
240
|
-
- spec/integration/an_organizer_with_before_each_callbacks_spec.rb
|
241
|
-
- spec/integration/an_organizer_performing_in_parallel_spec.rb
|
242
|
-
- spec/integration/an_organizer_with_around_each_callbacks_spec.rb
|
243
|
-
- spec/integration/a_basic_interactor_spec.rb
|
244
|
-
- spec/integration/an_interactor_with_an_existing_context_class_spec.rb
|
245
|
-
- spec/integration/an_interactor_with_validations_on_calling_spec.rb
|
246
|
-
- spec/integration/an_interactor_with_before_perform_callbacks_spec.rb
|
247
|
-
- spec/integration/an_organizer_with_options_callbacks_spec.rb
|
248
|
-
- spec/integration/an_interactor_with_around_perform_callbacks_spec.rb
|
249
|
-
- spec/integration/an_organizer_with_all_perform_callbacks.rb
|
250
|
-
- spec/integration/an_organizer_containing_organizer_with_after_callbacks_deferred_spec.rb
|
251
|
-
- spec/integration/an_interactor_with_after_rollback_callbacks_spec.rb
|
252
|
-
- spec/integration/active_record_integration_spec.rb
|
253
|
-
- spec/integration/an_interactor_with_around_rollback_callbacks_spec.rb
|
254
|
-
- spec/integration/an_interactor_with_after_context_validation_callbacks_spec.rb
|
255
|
-
- spec/integration/an_interactor_with_before_rollback_callbacks_spec.rb
|
256
|
-
- spec/integration/an_interactor_with_validations_on_called_spec.rb
|
257
|
-
- spec/integration/an_interactor_with_after_perform_callbacks_spec.rb
|
258
|
-
- spec/integration/an_organizer_with_conditionally_organized_interactors_spec.rb
|
259
|
-
- spec/integration/an_organizer_with_failing_nested_organizer_spec.rb
|
260
|
-
- spec/integration/a_failing_interactor_spec.rb
|
261
|
-
- spec/integration/an_organizer_with_after_each_callbacks_spec.rb
|
262
|
-
- spec/integration/a_basic_organizer_spec.rb
|
263
|
-
- spec/active_interactor/organizer/interactor_interface_collection_spec.rb
|
264
|
-
- spec/active_interactor/organizer/base_spec.rb
|
265
|
-
- spec/active_interactor/organizer/interactor_interface_spec.rb
|
266
|
-
- spec/active_interactor/config_spec.rb
|
267
|
-
- spec/active_interactor/base_spec.rb
|
268
|
-
- spec/active_interactor/context/base_spec.rb
|
269
|
-
- spec/active_interactor/error_spec.rb
|
270
|
-
- spec/active_interactor/interactor/worker_spec.rb
|
271
|
-
- spec/active_interactor/interactor/perform/options_spec.rb
|
272
|
-
- spec/active_interactor/version_spec.rb
|
273
|
-
- spec/support/helpers/factories.rb
|
274
|
-
- spec/support/spec_helpers.rb
|
275
|
-
- spec/support/shared_examples/a_class_that_extends_active_interactor_models_example.rb
|
276
|
-
- spec/support/shared_examples/a_class_with_interactor_context_methods_example.rb
|
277
|
-
- spec/support/shared_examples/a_class_with_interactor_callback_methods_example.rb
|
278
|
-
- spec/support/shared_examples/a_class_with_interactor_methods_example.rb
|
279
|
-
- spec/support/shared_examples/a_class_with_organizer_callback_methods_example.rb
|
280
|
-
- spec/support/coverage.rb
|
281
|
-
- spec/active_interactor_spec.rb
|
282
|
-
- spec/spec_helper.rb
|
162
|
+
test_files: []
|
@@ -1,85 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
|
5
|
-
RSpec.describe ActiveInteractor::Base do
|
6
|
-
let(:interactor_class) { described_class }
|
7
|
-
|
8
|
-
include_examples 'a class with interactor methods'
|
9
|
-
include_examples 'a class with interactor callback methods'
|
10
|
-
include_examples 'a class with interactor context methods'
|
11
|
-
|
12
|
-
describe '.contextualize_with' do
|
13
|
-
subject { described_class.contextualize_with(klass) }
|
14
|
-
|
15
|
-
context 'with an class that does not exist' do
|
16
|
-
let(:klass) { 'SomeClassThatDoesNotExist' }
|
17
|
-
|
18
|
-
it { expect { subject }.to raise_error(ActiveInteractor::Error::InvalidContextClass) }
|
19
|
-
end
|
20
|
-
|
21
|
-
context 'with context class TestContext' do
|
22
|
-
before { build_context }
|
23
|
-
|
24
|
-
context 'when passed as a string' do
|
25
|
-
let(:klass) { 'TestContext' }
|
26
|
-
|
27
|
-
it 'is expected to assign the appropriate context class' do
|
28
|
-
subject
|
29
|
-
expect(described_class.context_class).to eq TestContext
|
30
|
-
end
|
31
|
-
|
32
|
-
# https://github.com/aaronmallen/activeinteractor/issues/168
|
33
|
-
context 'when singularized' do
|
34
|
-
let!(:singularized_class) { build_context('PlaceData') }
|
35
|
-
let(:klass) { 'PlaceData' }
|
36
|
-
|
37
|
-
it 'is expected to assign the appropriate context class' do
|
38
|
-
subject
|
39
|
-
expect(described_class.context_class).to eq PlaceData
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
context 'when passed as a symbol' do
|
45
|
-
let(:klass) { :test_context }
|
46
|
-
|
47
|
-
it 'is expected to assign the appropriate context class' do
|
48
|
-
subject
|
49
|
-
expect(described_class.context_class).to eq TestContext
|
50
|
-
end
|
51
|
-
|
52
|
-
# https://github.com/aaronmallen/activeinteractor/issues/168
|
53
|
-
context 'when singularized' do
|
54
|
-
let!(:singularized_class) { build_context('PlaceData') }
|
55
|
-
let(:klass) { :place_data }
|
56
|
-
|
57
|
-
it 'is expected to assign the appropriate context class' do
|
58
|
-
subject
|
59
|
-
expect(described_class.context_class).to eq PlaceData
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
context 'when passed as a constant' do
|
65
|
-
let(:klass) { TestContext }
|
66
|
-
|
67
|
-
it 'is expected to assign the appropriate context class' do
|
68
|
-
subject
|
69
|
-
expect(described_class.context_class).to eq TestContext
|
70
|
-
end
|
71
|
-
|
72
|
-
# https://github.com/aaronmallen/activeinteractor/issues/168
|
73
|
-
context 'when singularized' do
|
74
|
-
let!(:singularized_class) { build_context('PlaceData') }
|
75
|
-
let(:klass) { PlaceData }
|
76
|
-
|
77
|
-
it 'is expected to assign the appropriate context class' do
|
78
|
-
subject
|
79
|
-
expect(described_class.context_class).to eq PlaceData
|
80
|
-
end
|
81
|
-
end
|
82
|
-
end
|
83
|
-
end
|
84
|
-
end
|
85
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
|
5
|
-
RSpec.describe ActiveInteractor::Config do
|
6
|
-
subject { described_class.new }
|
7
|
-
|
8
|
-
it { is_expected.to respond_to :logger }
|
9
|
-
|
10
|
-
describe '.defaults' do
|
11
|
-
subject { described_class.defaults }
|
12
|
-
|
13
|
-
it 'is expected to have attributes :logger => Logger.new' do
|
14
|
-
expect(subject[:logger]).to be_a Logger
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|