unidom-action 1.17.8 → 1.17.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 35a1ddf1d651c7c47f46f565225f1e12077f71ab
4
- data.tar.gz: 5fc152d0396f643dc51aa8e88b8233a9ebaf4272
3
+ metadata.gz: 351336aeb6830b9384658babb1ba7bce79b6aaff
4
+ data.tar.gz: a7dbf7dfb7c15c7c40fce6d4d01c5ab45f77b73e
5
5
  SHA512:
6
- metadata.gz: '09bb6ca560d99656459fac9f381356ea4711b01ea93b345ca3bb458cabaa923433793f7ca44d90972f3275bfd88b29dba67917f8f968f105aa47c3254668ad6a'
7
- data.tar.gz: 39fad39e1f09aa7b2624b60756c02ebfddaa02a916f758f8634ae6a0d526e5ea0892aa90a34da8e3c5a858d316b93187f5e795d25f76d687844b1b4fcdf4c087
6
+ metadata.gz: a31c4b73fc7750dd1c077d189de2232355fa21e3fea453617c868eb7eb868dbc9cd6da83901db45fb669706cd489205db602e8cd27c3d2bfcfe45b1ded73ba53
7
+ data.tar.gz: 55824a3a666171ab984a4e8daffd0a019c67d266c3a01025b944f5d6813f611890f53208c9a139a8b3f89a380313d817ac7bf5ca7ac440ed194f303b9790acb1
data/README.md CHANGED
@@ -240,8 +240,23 @@ require 'unidom/action/validators_rspec'
240
240
  ### RSpec shared examples (to be integrated)
241
241
 
242
242
  ```ruby
243
- # The Unidom::Action::Acting model, the Unidom::Action::Obsolescing model, the Unidom::Action::Searching model, & the Unidom::Action::StateTransition model already include the Unidom::Action::Concerns::AsCaused concern
243
+ # app/models/your_acted.rb
244
+ class YourActed < ApplicationRecord
245
+
246
+ include Unidom::Common::Concerns::ModelExtension
247
+ include Unidom::Action::Concerns::AsActed
244
248
 
249
+ end
250
+
251
+ # app/models/your_actor_party.rb
252
+ class YourActorParty < ApplicationRecord
253
+
254
+ include Unidom::Common::Concerns::ModelExtension
255
+ include Unidom::Action::Concerns::AsActorParty
256
+
257
+ end
258
+
259
+ # The Unidom::Action::Acting model, the Unidom::Action::Obsolescing model, the Unidom::Action::Searching model, & the Unidom::Action::StateTransition model already include the Unidom::Action::Concerns::AsCaused concern
245
260
  # app/models/your_caused.rb
246
261
  class YourCaused < ApplicationRecord
247
262
 
@@ -253,6 +268,26 @@ end
253
268
  # spec/support/unidom_rspec_shared_examples.rb
254
269
  require 'unidom/action/rspec_shared_examples'
255
270
 
271
+ # spec/models/your_acted_spec.rb
272
+ describe YourActed, type: :model do
273
+
274
+ model_attribtues = {
275
+ }
276
+
277
+ it_behaves_like 'Unidom::Action::Concerns::AsActed', model_attribtues
278
+
279
+ end
280
+
281
+ # spec/models/your_actor_party_spec.rb
282
+ describe YourActorParty, type: :model do
283
+
284
+ model_attribtues = {
285
+ }
286
+
287
+ it_behaves_like 'Unidom::Action::Concerns::AsActorParty', model_attribtues
288
+
289
+ end
290
+
256
291
  # spec/models/your_caused_spec.rb
257
292
  describe YourCaused, type: :model do
258
293
 
@@ -0,0 +1,21 @@
1
+ shared_examples 'Unidom::Action::Concerns::AsActed' do |model_attributes|
2
+
3
+ acting_1_attributes = {
4
+ actor_visitor_id: SecureRandom.uuid,
5
+ actor_visitor_type: 'Unidom::Action::ActorVisitor::Mock',
6
+ actor_party_id: SecureRandom.uuid,
7
+ actor_party_type: 'Unidom::Action::ActorParty::Mock',
8
+ reason_id: SecureRandom.uuid
9
+ }
10
+
11
+ acting_2_attributes = {
12
+ actor_visitor_id: SecureRandom.uuid,
13
+ actor_visitor_type: 'Unidom::Action::ActorVisitor::Mock',
14
+ actor_party_id: SecureRandom.uuid,
15
+ actor_party_type: 'Unidom::Action::ActorParty::Mock',
16
+ reason_id: SecureRandom.uuid
17
+ }
18
+
19
+ it_behaves_like 'has_many', model_attributes, :actings, Unidom::Action::Acting, [ acting_1_attributes, acting_2_attributes ]
20
+
21
+ end
@@ -0,0 +1,21 @@
1
+ shared_examples 'Unidom::Action::Concerns::AsActorParty' do |model_attributes|
2
+
3
+ acting_1_attributes = {
4
+ acted_id: SecureRandom.uuid,
5
+ acted_type: 'Unidom::Action::Acted::Mock',
6
+ actor_visitor_id: SecureRandom.uuid,
7
+ actor_visitor_type: 'Unidom::Action::ActorVisitor::Mock',
8
+ reason_id: SecureRandom.uuid
9
+ }
10
+
11
+ acting_2_attributes = {
12
+ acted_id: SecureRandom.uuid,
13
+ acted_type: 'Unidom::Action::Acted::Mock',
14
+ actor_visitor_id: SecureRandom.uuid,
15
+ actor_visitor_type: 'Unidom::Action::ActorVisitor::Mock',
16
+ reason_id: SecureRandom.uuid
17
+ }
18
+
19
+ it_behaves_like 'has_many', model_attributes, :acted_actings, Unidom::Action::Acting, [ acting_1_attributes, acting_2_attributes ]
20
+
21
+ end
@@ -1 +1,3 @@
1
+ require 'rspec/models/unidom/action/concerns/as_acted_shared_examples'
2
+ require 'rspec/models/unidom/action/concerns/as_actor_party_shared_examples'
1
3
  require 'rspec/models/unidom/action/concerns/as_caused_shared_examples'
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Action
3
- VERSION = '1.17.8'.freeze
3
+ VERSION = '1.17.9'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unidom-action
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.17.8
4
+ version: 1.17.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Topbit Du
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-30 00:00:00.000000000 Z
11
+ date: 2017-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unidom-common
@@ -69,6 +69,8 @@ files:
69
69
  - db/migrate/20000512000000_create_unidom_obsolescings.rb
70
70
  - db/migrate/20000513000000_create_unidom_searchings.rb
71
71
  - lib/rspec/models/unidom/action/acting_spec.rb
72
+ - lib/rspec/models/unidom/action/concerns/as_acted_shared_examples.rb
73
+ - lib/rspec/models/unidom/action/concerns/as_actor_party_shared_examples.rb
72
74
  - lib/rspec/models/unidom/action/concerns/as_caused_shared_examples.rb
73
75
  - lib/rspec/models/unidom/action/obsolescing_spec.rb
74
76
  - lib/rspec/models/unidom/action/reason_spec.rb