unidom-action 1.16.2 → 1.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +15 -0
- data/lib/rspec/models/unidom/action/acting_spec.rb +28 -0
- data/lib/rspec/models/unidom/action/obsolescing_spec.rb +26 -0
- data/lib/rspec/models/unidom/action/reason_spec.rb +20 -0
- data/lib/rspec/models/unidom/action/searching_spec.rb +32 -0
- data/lib/rspec/models/unidom/action/state_transition_spec.rb +27 -0
- data/lib/rspec/types/unidom/action/action_spec.rb +16 -0
- data/lib/rspec/types/unidom/action/obsolescence_spec.rb +13 -0
- data/lib/unidom/action/models_rspec.rb +5 -0
- data/lib/unidom/action/types_rspec.rb +2 -0
- data/lib/unidom/action/validators_rspec.rb +0 -0
- data/lib/unidom/action/version.rb +1 -1
- metadata +12 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d6bc7a2e8179fd0bd77c82e0b836563de494b9c
|
4
|
+
data.tar.gz: 3c537b3e1cd182ce6881f73dc0d15c4a25fea392
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7aad3c5747b8cc3e5c8a0650178261e2e80e3d7771e1cb98e833a6c4114f9a4d7d8074425975dd5fdc5b163f8392d29eee8ede4385421ee6e605ca4151e9ab8
|
7
|
+
data.tar.gz: 316db12ef79a7d600776f40a676156fcde2aadffa77fc7bb258afd9af48026f40328b1e2156670e7d3bca52f6a2ad36e7d73f7744035408d4e5558a821074476
|
data/README.md
CHANGED
@@ -211,3 +211,18 @@ Unidom::Common.configure do |options|
|
|
211
211
|
|
212
212
|
end
|
213
213
|
```
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
## RSpec examples
|
218
|
+
|
219
|
+
```ruby
|
220
|
+
# spec/models/unidom_spec.rb
|
221
|
+
require 'unidom/action/models_rspec'
|
222
|
+
|
223
|
+
# spec/types/unidom_spec.rb
|
224
|
+
require 'unidom/action/types_rspec'
|
225
|
+
|
226
|
+
# spec/validators/unidom_spec.rb
|
227
|
+
require 'unidom/action/validators_rspec'
|
228
|
+
```
|
@@ -0,0 +1,28 @@
|
|
1
|
+
describe Unidom::Action::Acting, type: :model do
|
2
|
+
|
3
|
+
before :each do
|
4
|
+
end
|
5
|
+
|
6
|
+
after :each do
|
7
|
+
end
|
8
|
+
|
9
|
+
context do
|
10
|
+
|
11
|
+
model_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
|
+
acted_id: SecureRandom.uuid,
|
17
|
+
acted_type: 'Unidom::Action::Acted::Mock',
|
18
|
+
reason_id: SecureRandom.uuid,
|
19
|
+
action_code: 'C',
|
20
|
+
from_value: {},
|
21
|
+
thru_value: {}
|
22
|
+
}
|
23
|
+
|
24
|
+
it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
describe Unidom::Action::Obsolescing, type: :model do
|
2
|
+
|
3
|
+
before :each do
|
4
|
+
end
|
5
|
+
|
6
|
+
after :each do
|
7
|
+
end
|
8
|
+
|
9
|
+
context do
|
10
|
+
|
11
|
+
model_attributes = {
|
12
|
+
obsolescer_visitor_id: SecureRandom.uuid,
|
13
|
+
obsolescer_visitor_type: 'Unidom::Action::ObsolescerVisitor::Mock',
|
14
|
+
obsolescer_party_id: SecureRandom.uuid,
|
15
|
+
obsolescer_party_type: 'Unidom::Action::ObsolescerParty::Mock',
|
16
|
+
obsolesced_id: SecureRandom.uuid,
|
17
|
+
obsolesced_type: 'Unidom::Action::Obsolesced::Mock',
|
18
|
+
reason_id: SecureRandom.uuid,
|
19
|
+
obsolescence_code: 'OBSL'
|
20
|
+
}
|
21
|
+
|
22
|
+
it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes
|
23
|
+
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
describe Unidom::Action::Reason, type: :model do
|
2
|
+
|
3
|
+
before :each do
|
4
|
+
end
|
5
|
+
|
6
|
+
after :each do
|
7
|
+
end
|
8
|
+
|
9
|
+
context do
|
10
|
+
|
11
|
+
model_attributes = {
|
12
|
+
name: 'Reason #1',
|
13
|
+
activity_code: 'ZZZZ'
|
14
|
+
}
|
15
|
+
|
16
|
+
it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
describe Unidom::Action::Searching, type: :model do
|
2
|
+
|
3
|
+
before :each do
|
4
|
+
end
|
5
|
+
|
6
|
+
after :each do
|
7
|
+
end
|
8
|
+
|
9
|
+
context do
|
10
|
+
|
11
|
+
model_attributes = {
|
12
|
+
searcher_visitor_id: SecureRandom.uuid,
|
13
|
+
searcher_visitor_type: 'Unidom::Action::Searcher::Mock',
|
14
|
+
searcher_party_id: SecureRandom.uuid,
|
15
|
+
searcher_party_type: 'Unidom::Action::SearcherParty::Mock',
|
16
|
+
reason_id: SecureRandom.uuid,
|
17
|
+
resource_name: 'users',
|
18
|
+
platform_name: 'administration',
|
19
|
+
platform_version: 2,
|
20
|
+
criteria: { name: 'admin' },
|
21
|
+
found_count: 63,
|
22
|
+
shown_count: 10,
|
23
|
+
per_page: 10,
|
24
|
+
total_pages: 7,
|
25
|
+
current_page: 2
|
26
|
+
}
|
27
|
+
|
28
|
+
it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
describe Unidom::Action::StateTransition, type: :model do
|
2
|
+
|
3
|
+
before :each do
|
4
|
+
end
|
5
|
+
|
6
|
+
after :each do
|
7
|
+
end
|
8
|
+
|
9
|
+
context do
|
10
|
+
|
11
|
+
model_attributes = {
|
12
|
+
transitor_visitor_id: SecureRandom.uuid,
|
13
|
+
transitor_visitor_type: 'Unidom::Action::TransitorVisitor::Mock',
|
14
|
+
transitor_party_id: SecureRandom.uuid,
|
15
|
+
transitor_party_type: 'Unidom::Action::TransitorParty::Mock',
|
16
|
+
subject_id: SecureRandom.uuid,
|
17
|
+
subject_type: 'Unidom::Action::Subject::Mock',
|
18
|
+
reason_id: SecureRandom.uuid,
|
19
|
+
from_state: 'C',
|
20
|
+
thru_state: 'A'
|
21
|
+
}
|
22
|
+
|
23
|
+
it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
describe Unidom::Action::Action, type: :type do
|
2
|
+
|
3
|
+
before :each do
|
4
|
+
end
|
5
|
+
|
6
|
+
after :each do
|
7
|
+
end
|
8
|
+
|
9
|
+
it_behaves_like 'ProgneTapera::EnumConfig', 5, [
|
10
|
+
{ code: 'C', name: 'create', localized_name: '创建' },
|
11
|
+
{ code: 'D', name: 'destroy', localized_name: '销毁' },
|
12
|
+
{ code: 'I', name: 'index', localized_name: '检索' },
|
13
|
+
{ code: 'S', name: 'show', localized_name: '显示' },
|
14
|
+
{ code: 'U', name: 'update', localized_name: '更新' } ]
|
15
|
+
|
16
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
describe Unidom::Action::Obsolescence, type: :type do
|
2
|
+
|
3
|
+
before :each do
|
4
|
+
end
|
5
|
+
|
6
|
+
after :each do
|
7
|
+
end
|
8
|
+
|
9
|
+
it_behaves_like 'ProgneTapera::EnumConfig', 2, [
|
10
|
+
{ code: 'OBSL', name: 'obsolesce', localized_name: '过期' },
|
11
|
+
{ code: 'RCVR', name: 'recover', localized_name: '恢复' } ]
|
12
|
+
|
13
|
+
end
|
@@ -0,0 +1,5 @@
|
|
1
|
+
require 'rspec/models/unidom/action/reason_spec' unless Unidom::Common::Neglection.namespace_neglected? 'Unidom::Action::Reason'
|
2
|
+
require 'rspec/models/unidom/action/acting_spec' unless Unidom::Common::Neglection.namespace_neglected? 'Unidom::Action::Acting'
|
3
|
+
require 'rspec/models/unidom/action/state_transition_spec' unless Unidom::Common::Neglection.namespace_neglected? 'Unidom::Action::StateTransition'
|
4
|
+
require 'rspec/models/unidom/action/obsolescing_spec' unless Unidom::Common::Neglection.namespace_neglected? 'Unidom::Action::Obsolescing'
|
5
|
+
require 'rspec/models/unidom/action/searching_spec' unless Unidom::Common::Neglection.namespace_neglected? 'Unidom::Action::Searching'
|
File without changes
|
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.
|
4
|
+
version: '1.17'
|
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-
|
11
|
+
date: 2017-02-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unidom-common
|
@@ -67,9 +67,19 @@ files:
|
|
67
67
|
- db/migrate/20000511000000_create_unidom_state_transitions.rb
|
68
68
|
- db/migrate/20000512000000_create_unidom_obsolescings.rb
|
69
69
|
- db/migrate/20000513000000_create_unidom_searchings.rb
|
70
|
+
- lib/rspec/models/unidom/action/acting_spec.rb
|
71
|
+
- lib/rspec/models/unidom/action/obsolescing_spec.rb
|
72
|
+
- lib/rspec/models/unidom/action/reason_spec.rb
|
73
|
+
- lib/rspec/models/unidom/action/searching_spec.rb
|
74
|
+
- lib/rspec/models/unidom/action/state_transition_spec.rb
|
75
|
+
- lib/rspec/types/unidom/action/action_spec.rb
|
76
|
+
- lib/rspec/types/unidom/action/obsolescence_spec.rb
|
70
77
|
- lib/tasks/action_tasks.rake
|
71
78
|
- lib/unidom/action.rb
|
72
79
|
- lib/unidom/action/engine.rb
|
80
|
+
- lib/unidom/action/models_rspec.rb
|
81
|
+
- lib/unidom/action/types_rspec.rb
|
82
|
+
- lib/unidom/action/validators_rspec.rb
|
73
83
|
- lib/unidom/action/version.rb
|
74
84
|
homepage: https://github.com/topbitdu/unidom-action
|
75
85
|
licenses:
|