validates_zipcode 0.0.3 → 0.0.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: eb84ecd52313d0e077ddae839ea70e3afcb0dfcc
4
- data.tar.gz: fe461836cc00d0a52050414377ba3a420e7b9ea6
3
+ metadata.gz: ce3428384df1296dc59b3a6cd5d4851627145efc
4
+ data.tar.gz: 0ee7e5839e662b71527b2189e6b081b04489dd29
5
5
  SHA512:
6
- metadata.gz: d3e1ad47b5e8fab5075bd2fa101711c7b36658429c18fd1c4d815ca80cdabe911835dd7a21006f7ceb9b4bc8e0f2a7c4c82901eae89860128d9ce0113ce50e86
7
- data.tar.gz: d8fb4c72df0d51444465590e3b84efd6e74905efb0261c25743f2944007a2119c1ef2d877c66d636450b3baae79a24c04cf3c064da3e20d97db22cbced92a9f4
6
+ metadata.gz: 48b420457da2ba3c35f5228cb56da96850f8e0f844c7682936e8a8690e280d11593295fd409d0cd68b90e34ed4cb4282a73702cce3411b57e291c546d886207c
7
+ data.tar.gz: 0d1a4be22635a40aaddbd5549a7d7f1923d8a6dfe5b566eedc70591ab880d7b8a4c3206d1d2d2a0062862b507fbfcb2f9b94de211a13bc3a812f33495c5b94ce
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # ValidatesZipcode [![Build Status](https://secure.travis-ci.org/dgilperez/validates_zipcode.png)](https://travis-ci.org/dgilperez/validates_zipcode) [![Gem Version](https://badge.fury.io/rb/validates_zipcode.svg)](http://badge.fury.io/rb/validates_zipcode)
1
+ # ValidatesZipcode [![Build Status](https://secure.travis-ci.org/dgilperez/validates_zipcode.png)](https://travis-ci.org/dgilperez/validates_zipcode) [![Code Climate](https://codeclimate.com/github/dgilperez/validates_zipcode/badges/gpa.svg)](https://codeclimate.com/github/dgilperez/validates_zipcode) [![Gem Version](https://badge.fury.io/rb/validates_zipcode.svg)](http://badge.fury.io/rb/validates_zipcode)
2
2
 
3
3
  Add zipcode validation support to Rails (ActiveModel), considering different zipcode country formats.
4
4
 
@@ -121,7 +121,7 @@ module ValidatesZipcode
121
121
  AS: /\A96799\z/,
122
122
  CC: /\A6799\z/,
123
123
  CK: /\A\d{4}\z/,
124
- RS: /\A\d{6}\z/,
124
+ RS: /\A\d{5}\z/,
125
125
  ME: /\A8\d{4}\z/,
126
126
  CS: /\A\d{5}\z/,
127
127
  YU: /\A\d{5}\z/,
@@ -1,3 +1,3 @@
1
1
  module ValidatesZipcode
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -95,6 +95,18 @@ describe ValidatesZipcode, '#validate_each' do
95
95
  end
96
96
  end
97
97
 
98
+ context 'Serbia' do
99
+ it 'validates with a valid zipcode' do
100
+ record = build_record('21000', 'RS')
101
+ zipcode_should_be_valid(record)
102
+ end
103
+
104
+ it 'does not validate with an invalid zipcode' do
105
+ record = build_record('2100', 'RS')
106
+ zipcode_should_be_invalid(record)
107
+ end
108
+ end
109
+
98
110
  context "unknown country" do
99
111
  it 'does not add errors with a any zipcode' do
100
112
  record = build_record('A1J2Z9', 'ZZ')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: validates_zipcode
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Gil
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-27 00:00:00.000000000 Z
11
+ date: 2015-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel