unidom-common-rspec 0.9 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -1
- data/Gemfile.lock +1 -1
- data/ROADMAP.md +7 -1
- data/lib/unidom/common/rspec/validates_shared_examples.rb +14 -7
- data/lib/unidom/common/rspec/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e28568165c67bc6f4aa46a5e162f3fdc4b2558b
|
4
|
+
data.tar.gz: e3621f4fe0cbd2ad0c3614f88443893e91d1bc0c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c6c1a846436b66b8009a05ca4be54939ba5ee4f44547d877f802251454b9a6b2f94bf36fa21f57a521155b7fdb0c2060479cf37058960a79f4616092f811bac
|
7
|
+
data.tar.gz: 3fee500adaed6ba6910d2488354639c5322d9df93251db2b3c8847b82db7e594a9ad8e54194a687dc11c7edb7606aadc827b60609313185606b7effed12f3470
|
data/CHANGELOG.md
CHANGED
@@ -31,7 +31,7 @@
|
|
31
31
|
1. Each Validator shared examples
|
32
32
|
|
33
33
|
## v0.7.1
|
34
|
-
1. Improved the Model Extension shared examples for the ``ordinal_is`` scope, the
|
34
|
+
1. Improved the Model Extension shared examples for the ``ordinal_is`` scope, the ``grade_is`` scope, the .grade_higher_than scope, the .grade_lower_than scope, the .priority_is scope, the .priority_higher_than scope, & the .priority_lower_than scope
|
35
35
|
2. Improved the Model Extension shared examples for the #ordinal validation
|
36
36
|
|
37
37
|
## v0.7.2
|
@@ -44,3 +44,6 @@
|
|
44
44
|
## v0.9
|
45
45
|
1. Validates Text shared examples
|
46
46
|
2. Validates Numericality shared examples
|
47
|
+
|
48
|
+
## v0.9.1
|
49
|
+
1. Improve the Validates Text shared examples for the length
|
data/Gemfile.lock
CHANGED
data/ROADMAP.md
CHANGED
@@ -31,7 +31,7 @@
|
|
31
31
|
1. Each Validator shared examples
|
32
32
|
|
33
33
|
## v0.7.1
|
34
|
-
1. Improve the Model Extension shared examples for the ``ordinal_is`` scope, the
|
34
|
+
1. Improve the Model Extension shared examples for the ``ordinal_is`` scope, the ``grade_is`` scope, the .grade_higher_than scope, the .grade_lower_than scope, the .priority_is scope, the .priority_higher_than scope, & the .priority_lower_than scope
|
35
35
|
2. Improve the Model Extension shared examples for the #ordinal validation
|
36
36
|
|
37
37
|
## v0.7.2
|
@@ -44,3 +44,9 @@
|
|
44
44
|
## v0.9
|
45
45
|
1. Validates Text shared examples
|
46
46
|
2. Validates Numericality shared examples
|
47
|
+
|
48
|
+
## v0.9.1
|
49
|
+
1. Improve the Validates Text shared examples for the length
|
50
|
+
|
51
|
+
## v0.10
|
52
|
+
1. Assert Present shared examples
|
@@ -60,13 +60,20 @@ shared_examples 'validates text' do |model_attributes, attribute_name, options|
|
|
60
60
|
symbols = '~`!@#$%^&*()-_=+{}[];:"\',.<>/?\\|'.chars
|
61
61
|
chars = numbers+letters+symbols
|
62
62
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
63
|
+
if minimum_length==maximum_length
|
64
|
+
length = maximum_length
|
65
|
+
chars.each do |c| attributes_collection[ { attribute_name => c*(length-1) } ] = 1 end
|
66
|
+
chars.each do |c| attributes_collection[ { attribute_name => c*length } ] = 0 end
|
67
|
+
chars.each do |c| attributes_collection[ { attribute_name => c*(length+1) } ] = 1 end
|
68
|
+
else
|
69
|
+
chars.each do |c| attributes_collection[ { attribute_name => c } ] = 0 end if 1==minimum_length
|
70
|
+
chars.each do |c| attributes_collection[ { attribute_name => c*(minimum_length-1) } ] = 1 end if minimum_length>1
|
71
|
+
chars.each do |c| attributes_collection[ { attribute_name => c*minimum_length } ] = 0 end
|
72
|
+
chars.each do |c| attributes_collection[ { attribute_name => c*(minimum_length+1) } ] = 0 end if minimum_length<maximum_length
|
73
|
+
chars.each do |c| attributes_collection[ { attribute_name => c*(maximum_length-1) } ] = 0 end
|
74
|
+
chars.each do |c| attributes_collection[ { attribute_name => c*maximum_length } ] = 0 end
|
75
|
+
chars.each do |c| attributes_collection[ { attribute_name => c*(maximum_length+1) } ] = 1 end
|
76
|
+
end
|
70
77
|
|
71
78
|
it_behaves_like 'validates', model_attributes, attribute_name, attributes_collection
|
72
79
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unidom-common-rspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Topbit Du
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec-rails
|