unidom-score 1.1.4 → 1.1.5
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca42a8e48ff6eb78860c747aa517a282fe01c58c
|
4
|
+
data.tar.gz: 667eecfd49f8b46fb5eb8082e2e901ad7885b840
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abce5258947fd83d0a7010479891af132a31759d83996debafa10fe0f6d2d69511e2c6c085e22cfabb5c790c6a25178f56a4b9c0ea9bba5bf78371e534f291dc
|
7
|
+
data.tar.gz: bd7aad8034eccaa11cf480f8b22219b29fb4d4aae23de5c90416e2e32378807b076f3d2716b30ca59e5c599a112706345f20ead774df3c2d6d324b2ef24aab9b
|
@@ -19,42 +19,13 @@ describe Unidom::Score::ScoreSheet, type: :model do
|
|
19
19
|
scored_on: Date.current
|
20
20
|
}
|
21
21
|
|
22
|
-
name_max_length = described_class.columns_hash['name'].limit
|
23
|
-
|
24
22
|
it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes
|
25
23
|
|
26
|
-
it_behaves_like 'validates', model_attributes, :
|
27
|
-
|
28
|
-
{ score: nil } => 2,
|
29
|
-
{ score: '' } => 2,
|
30
|
-
{ score: '1' } => 0,
|
31
|
-
{ score: 1 } => 0,
|
32
|
-
{ score: 'A' } => 1,
|
33
|
-
{ score: '0.00' } => 0,
|
34
|
-
{ score: 0.00 } => 0,
|
35
|
-
{ score: '-999_999_999.99' } => 0,
|
36
|
-
{ score: -999_999_999.99 } => 0,
|
37
|
-
{ score: '-1_000_000_000' } => 0,
|
38
|
-
{ score: -1_000_000_000 } => 0,
|
39
|
-
{ score: '-1_000_000_000.01' } => 1,
|
40
|
-
{ score: -1_000_000_000.01 } => 1,
|
41
|
-
{ score: '999_999_999.99' } => 0,
|
42
|
-
{ score: 999_999_999.99 } => 0,
|
43
|
-
{ score: '1_000_000_000' } => 0,
|
44
|
-
{ score: 1_000_000_000 } => 0,
|
45
|
-
{ score: '1_000_000_000.01' } => 1,
|
46
|
-
{ score: 1_000_000_000.01 } => 1
|
24
|
+
it_behaves_like 'validates text', model_attributes, :name,
|
25
|
+
length: 2..described_class.columns_hash['name'].limit
|
47
26
|
|
48
|
-
it_behaves_like 'validates', model_attributes, :
|
49
|
-
|
50
|
-
{ name: nil } => 0,
|
51
|
-
{ name: '' } => 0,
|
52
|
-
{ name: 'A' } => 1,
|
53
|
-
{ name: 'AA' } => 0,
|
54
|
-
{ name: 'AAA' } => 0,
|
55
|
-
{ name: 'A'*(name_max_length-1) } => 0,
|
56
|
-
{ name: 'A'*name_max_length } => 0,
|
57
|
-
{ name: 'A'*(name_max_length+1) } => 1
|
27
|
+
it_behaves_like 'validates numericality', model_attributes, :score,
|
28
|
+
range: -1_000_000_000..1_000_000_000, minimum_inclusive: true, maximum_inclusive: true, only_integer: false
|
58
29
|
|
59
30
|
score_sheet_template_attributes = {
|
60
31
|
subject_id: SecureRandom.uuid,
|
@@ -17,6 +17,12 @@ describe Unidom::Score::ScoreSheetTemplate, type: :model do
|
|
17
17
|
|
18
18
|
it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes
|
19
19
|
|
20
|
+
it_behaves_like 'validates text', model_attributes, :name,
|
21
|
+
length: 2..described_class.columns_hash['name'].limit
|
22
|
+
|
23
|
+
it_behaves_like 'validates numericality', model_attributes, :score,
|
24
|
+
range: -1_000_000_000..1_000_000_000, minimum_inclusive: true, maximum_inclusive: true, only_integer: false
|
25
|
+
|
20
26
|
end
|
21
27
|
|
22
28
|
end
|
data/lib/unidom/score/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unidom-score
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.5
|
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-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unidom-common
|