has_validated_attributes 1.0.2 → 1.0.3
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: 602d4c79ed7b97aa059079f61e4c3370fd6f979f
|
4
|
+
data.tar.gz: ab76cf7ff7ecfd1e5149d31fe3d6a61b06d6dcf0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 942bdad9be66a96dd36eef3b9f7a3a95cb01fcada8106a444d7adfd27f4e40b88d0e318e9a823326e9ea0b90eedc0bcff2ce0edd74de672ad5e64c0e5ffa60b5
|
7
|
+
data.tar.gz: c77c5cec9648ebc4e4d7c16592fefe5ed26b9bb261f171323325b02c586e1f7ed7a13bfc3b309681cd433bcc9d29e7b6d271ca5558ce824fdaf1f3fb145a12f0
|
@@ -46,7 +46,7 @@ module HasValidatedAttributes
|
|
46
46
|
:positive_dollar => {:format => {:with => /\A[0-9]{0,12}(\.[0-9]{0,2})?\z/, :message => "accepts only numeric characters, period"}, :numericality => {:greater_than_or_equal_to => 0, :less_than => 1000000000000}, :allow_nil => true},
|
47
47
|
:percent => {:format => {:with => /\A-?[0-9]{0,4}(\.[0-9]{0,4})?\z/, :message => "accepts only numeric characters, period, negative sign, and must be equal/less/greater than +/- 100"}, :numericality => {:greater_than_or_equal_to => -100, :less_than_or_equal_to => 100}, :has_if? => true},
|
48
48
|
:positive_percent => {:format => {:with => /\A[0-9]{0,4}(\.[0-9]{0,4})?\z/, :message => "accepts only numeric characters, period, and must be equal/less than 100"}, :numericality => {:greater_than_or_equal_to => 0, :less_than_or_equal_to => 100}, :allow_nil => true},
|
49
|
-
:url => {:length => {:maximum => 255}, :format => {:with =>
|
49
|
+
:url => {:length => {:maximum => 255}, :format => {:with => URI.regexp, :message => "web address isnt valid"}, :has_if? => true},
|
50
50
|
:social_security_number => {:length => {:is => 9}, :numericality => {:greater_than_or_equal_to => 0, :less_than => 1000000000, :message => "must be in the format 111-11-1111"}, :has_if? => true},
|
51
51
|
:taxid => {:length => {:is => 9}, :numericality => {:greater_than_or_equal_to => 9999999, :less_than => 1000000000, :message => "must be in the format 11-1111111"}, :has_if? => true},
|
52
52
|
:age => {:numericality => {:greater_than_or_equal_to => 0, :less_than_or_equal_to => 110, :message => 'must contain only 3 numbers and less than 110'}, :has_if? => true},
|
@@ -148,7 +148,7 @@ RSpec.shared_examples_for "url attribute" do |attr, allowed: nil, disallowed: ni
|
|
148
148
|
end
|
149
149
|
|
150
150
|
(disallowed || [
|
151
|
-
"finance.example.com", "www.example.com", "
|
151
|
+
"finance.example.com", "www.example.com", ">*", "< test",
|
152
152
|
"www.test..com", "www.test.c", "www-test.com", "abc", "123", "&*()", "www.test-com"
|
153
153
|
]).each do |url|
|
154
154
|
it { should_not allow_value(url).for(attr).with_message(HasValidatedAttributes.url_format[:format][:message]) }
|