unidom-score 1.1.3 → 1.1.4

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: cadb2c022e3fad8aac8f6559439179ea2ffc543a
4
- data.tar.gz: e7c3ed70f577326f5becda38a297bcd1190aebc9
3
+ metadata.gz: 2c891605818a7e2af5ae1e1241461c6fe041b140
4
+ data.tar.gz: 8ea05f1f13deec9e8e279ef8b5d2caed17407d61
5
5
  SHA512:
6
- metadata.gz: 6cf45e3b453d4b9b3ee87f40b28be95040a27904b42b29fe8de5b92138b82a7b6c026886a08d60cf387b08197727171c8363c0289a7e07fb4a11c8d353a2d20e
7
- data.tar.gz: c31d8986dc43650cf76778163de8a884f209da4fd9a5b9d4ce5fe63d5dce5c1c3e4a03f1c65b1c81e62e726f1f9accb750ad74778debd2c301f8c7a1d16b4e8e
6
+ metadata.gz: 8e30d2506d30b8b87e5c8ed5c44b665cf79aeb12cef7781ef72655fd091d8b245619b93c93bad5153e4f1c5183e6ea068c646b20987f03fd9188fbe4a878e371
7
+ data.tar.gz: 4f85de5a9cf80bf254428089ffa38519a9ead57d8763605be8596fd376b623fff6cb575ee92c9441b60d7fba152c210e123471e30da58f5eaff6191d0d6b687b
@@ -18,10 +18,11 @@ describe Unidom::Score::ScoreItem, type: :model do
18
18
  scored_on: Date.current
19
19
  }
20
20
 
21
- title_max_length = described_class.columns_hash['title'].limit
22
-
23
21
  it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes
24
22
 
23
+ it_behaves_like 'validates text', model_attributes, :title,
24
+ length: 2..described_class.columns_hash['title'].limit, allow_blank: true
25
+
25
26
  it_behaves_like 'validates', model_attributes, :score,
26
27
  { } => 0,
27
28
  { score: nil } => 2,
@@ -44,17 +45,6 @@ describe Unidom::Score::ScoreItem, type: :model do
44
45
  { score: '1_000_000_000.01' } => 1,
45
46
  { score: 1_000_000_000.01 } => 1
46
47
 
47
- it_behaves_like 'validates', model_attributes, :title,
48
- { } => 0,
49
- { title: nil } => 0,
50
- { title: '' } => 0,
51
- { title: 'A' } => 1,
52
- { title: 'AA' } => 0,
53
- { title: 'AAA' } => 0,
54
- { title: 'A'*(title_max_length-1) } => 0,
55
- { title: 'A'*title_max_length } => 0,
56
- { title: 'A'*(title_max_length+1) } => 1
57
-
58
48
  score_sheet_attributes = {
59
49
  template_id: SecureRandom.uuid,
60
50
  scorer_id: SecureRandom.uuid,
@@ -16,6 +16,9 @@ describe Unidom::Score::ScoreItemTemplate, type: :model do
16
16
 
17
17
  it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes
18
18
 
19
+ it_behaves_like 'validates text', model_attributes, :title,
20
+ length: 2..described_class.columns_hash['title'].limit
21
+
19
22
  score_sheet_template_attributes = {
20
23
  subject_id: SecureRandom.uuid,
21
24
  subject_type: 'Unidom::Score::Subject::Mock',
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Score
3
- VERSION = '1.1.3'.freeze
3
+ VERSION = '1.1.4'.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.3
4
+ version: 1.1.4
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-16 00:00:00.000000000 Z
11
+ date: 2017-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unidom-common