unidom-score 1.1.5 → 1.1.6

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: ca42a8e48ff6eb78860c747aa517a282fe01c58c
4
- data.tar.gz: 667eecfd49f8b46fb5eb8082e2e901ad7885b840
3
+ metadata.gz: 056ae610c074bf7972df64a95f69e9635485ad1d
4
+ data.tar.gz: cde0857376c46b3b968d77be25e84e792b5c85fe
5
5
  SHA512:
6
- metadata.gz: abce5258947fd83d0a7010479891af132a31759d83996debafa10fe0f6d2d69511e2c6c085e22cfabb5c790c6a25178f56a4b9c0ea9bba5bf78371e534f291dc
7
- data.tar.gz: bd7aad8034eccaa11cf480f8b22219b29fb4d4aae23de5c90416e2e32378807b076f3d2716b30ca59e5c599a112706345f20ead774df3c2d6d324b2ef24aab9b
6
+ metadata.gz: eea1380f9d3169d16779dcbe676a764ad44d10fdc86b2f9156caabc15c64531e18069bbf3f2f5feed74a58c7066eaba481b24d27cb0e81bbe941273b2d2cafd8
7
+ data.tar.gz: b3d2e6c9a4b56aa1fdf92462d41a34bf7455e74a52abecd8f37c9b4c33328cd6056bbbedad061b5cdac763cb14b922b19813e5f6c7b2f1b82916a7c788f6e6b7
@@ -23,27 +23,8 @@ describe Unidom::Score::ScoreItem, type: :model do
23
23
  it_behaves_like 'validates text', model_attributes, :title,
24
24
  length: 2..described_class.columns_hash['title'].limit, allow_blank: true
25
25
 
26
- it_behaves_like 'validates', model_attributes, :score,
27
- { } => 0,
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
26
+ it_behaves_like 'validates numericality', model_attributes, :score,
27
+ range: -1_000_000_000..1_000_000_000, minimum_inclusive: true, maximum_inclusive: true
47
28
 
48
29
  score_sheet_attributes = {
49
30
  template_id: SecureRandom.uuid,
@@ -19,6 +19,9 @@ describe Unidom::Score::ScoreItemTemplate, type: :model do
19
19
  it_behaves_like 'validates text', model_attributes, :title,
20
20
  length: 2..described_class.columns_hash['title'].limit
21
21
 
22
+ it_behaves_like 'validates numericality', model_attributes, :score,
23
+ range: -1_000_000_000..1_000_000_000, minimum_inclusive: true, maximum_inclusive: true
24
+
22
25
  score_sheet_template_attributes = {
23
26
  subject_id: SecureRandom.uuid,
24
27
  subject_type: 'Unidom::Score::Subject::Mock',
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Score
3
- VERSION = '1.1.5'.freeze
3
+ VERSION = '1.1.6'.freeze
4
4
  end
5
5
  end
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.5
4
+ version: 1.1.6
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-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unidom-common