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 +4 -4
- data/README.md +36 -1
- data/lib/rspec/models/unidom/action/concerns/as_acted_shared_examples.rb +21 -0
- data/lib/rspec/models/unidom/action/concerns/as_actor_party_shared_examples.rb +21 -0
- data/lib/unidom/action/rspec_shared_examples.rb +2 -0
- data/lib/unidom/action/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 351336aeb6830b9384658babb1ba7bce79b6aaff
|
4
|
+
data.tar.gz: a7dbf7dfb7c15c7c40fce6d4d01c5ab45f77b73e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
#
|
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
|
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.
|
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
|
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
|