validates_zipcode 0.0.10 → 0.0.11

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: d92ec44117812b43729e6458b3df9671b1fa094a
4
- data.tar.gz: 74f57e1b70b7e2d4f1154310b0c7db7e6923cfba
3
+ metadata.gz: cf10d7923790f275f72651452d63b08204c323ac
4
+ data.tar.gz: e933362da9fe6d1d7f0d390061d2008daef6a864
5
5
  SHA512:
6
- metadata.gz: 6b1e90c726fb81dc5531eb2b6a7b315547fb494c57d69cc0b6577b92e0f46a0a885ffc8ba5a00f6d4533dbbf2e2755d284e6200ad0f60ed0092e56fd0235dcd7
7
- data.tar.gz: 1b0222049366748e77a7fa6d329676dd113103dccdbadc475eab09bc4bc5c9f61d4dd966bdc9c5aa15747e4d4af985f711dd55a85b9994547a875a66f3ae7a45
6
+ metadata.gz: e86d3408de58bec92855c0cc605534891862e79689b10f613086fc179be7c9043bbfee7e4e80db71de525474e906c3988ab42a5e4e86a218e4b4cee382af8dd0
7
+ data.tar.gz: 38ca9144c735aa01885df93c351a8d1c7e68b94ae0523818d94262b7a18a8a8d049343fc5e46efe2aae1fd4b7c1afe1c6924792126714d32a79910ca1fe7431e
@@ -1,6 +1,10 @@
1
1
  # Changelog
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
+ ## 0.0.11
5
+
6
+ - Fix Brazil zipcode ~ @pedrosfdcarneiro
7
+
4
8
  ## 0.0.10
5
9
 
6
10
  - Support zip+6 for the USA ~ @dimroc
@@ -148,7 +148,7 @@ module ValidatesZipcode
148
148
  BI: /\A([a-zA-Z\d\s]){3,}\z/,
149
149
  BS: /\A([a-zA-Z\d\s]){3,}\z/,
150
150
  BZ: /\A([a-zA-Z\d\s]){3,}\z/,
151
- BR: /\A\d{4}[a-zA-Z][\- | [ ]]\d{2}[a-zA-Z]\z/,
151
+ BR: /\A\d{5}(-?\d{3})?\z/,
152
152
  BJ: /\A([a-zA-Z\d\s]){3,}\z/,
153
153
  BT: /\A\d{5}\z/,
154
154
  BQ: /\A([a-zA-Z\d\s]){3,}\z/,
@@ -1,3 +1,3 @@
1
1
  module ValidatesZipcode
2
- VERSION = "0.0.10"
2
+ VERSION = "0.0.11"
3
3
  end
@@ -152,6 +152,20 @@ describe ValidatesZipcode, '#validate_each' do
152
152
  end
153
153
  end
154
154
 
155
+ context 'Brazil' do
156
+ it 'validates with a valid zipcode' do
157
+ ['72315', '72315-500', '72315500', '24210-325', '24210325'].each do |zipcode|
158
+ record = build_record(zipcode, 'BR')
159
+ zipcode_should_be_valid(record)
160
+ end
161
+ end
162
+
163
+ it 'does not validate with an invalid zipcode' do
164
+ record = build_record('723155', 'BR')
165
+ zipcode_should_be_invalid(record)
166
+ end
167
+ end
168
+
155
169
  context 'Czech' do
156
170
  it 'validates with a valid zipcode' do
157
171
  ['12000', '721 00'].each do |zipcode|
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.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Gil
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-16 00:00:00.000000000 Z
11
+ date: 2016-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel