spree_cpf 2.1.3 → 2.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/.travis.yml +1 -1
- data/Gemfile +3 -0
- data/README.md +1 -2
- data/config/locales/en.yml +9 -4
- data/spec/features/frontend/checkout_spec.rb +17 -1
- data/spree_cpf.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85154b4a986d48adc20672ab333c560f6650ebc5
|
4
|
+
data.tar.gz: da8f5a6e7b942e238667bf7e4f38689dd7446d9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4465bcfb38ff50b54e37903a095ffd64aa0388031f04e1b1da5ba5e0ec9d5bda7f50df6f411d20d845d29006169a6e274f492b9e2ecb9ccb5b7041ad67c177d2
|
7
|
+
data.tar.gz: b33a4a45fb7d80e597c05755247f6ed3a974c90191fabdba8efdf9ae180d53866204b8dc9be832ec62bbdd39a303a083e766405a517b2163c48afcd25642d1ba
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.1.
|
1
|
+
2.1.2
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
@@ -2,6 +2,9 @@ source 'https://rubygems.org'
|
|
2
2
|
|
3
3
|
gem 'spree', github: 'spree/spree', branch: '2-1-stable'
|
4
4
|
|
5
|
+
# Sprockets 2.12 is behaving strangely
|
6
|
+
gem 'sprockets', '~> 2.11.0'
|
7
|
+
|
5
8
|
platforms :jruby do
|
6
9
|
gem 'activerecord-jdbcsqlite3-adapter'
|
7
10
|
gem 'activerecord-jdbcpostgresql-adapter'
|
data/README.md
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
SpreeCpf
|
2
2
|
========
|
3
3
|
|
4
|
-
[](https://bitdeli.com/free "Bitdeli Badge")
|
5
4
|
[](https://travis-ci.org/tiagoamaro/spree_cpf)
|
6
5
|
[](https://coveralls.io/r/tiagoamaro/spree_cpf?branch=2-1-stable)
|
7
6
|
[](https://gemnasium.com/tiagoamaro/spree_cpf)
|
@@ -50,4 +49,4 @@ Simply add this require statement to your spec_helper:
|
|
50
49
|
require 'spree_cpf/factories'
|
51
50
|
```
|
52
51
|
|
53
|
-
Copyright (c)
|
52
|
+
Copyright (c) 2014 Tiago Amaro, released under the MIT License
|
data/config/locales/en.yml
CHANGED
@@ -1,5 +1,10 @@
|
|
1
|
-
# Sample localization file for English. Add more files in this directory for other locales.
|
2
|
-
# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
|
3
|
-
|
4
1
|
en:
|
5
|
-
|
2
|
+
activerecord:
|
3
|
+
errors:
|
4
|
+
models:
|
5
|
+
spree/order:
|
6
|
+
attributes:
|
7
|
+
ship_address:
|
8
|
+
cpf_invalid: CPF is invalid
|
9
|
+
bill_address:
|
10
|
+
cpf_invalid: CPF is invalid
|
@@ -15,6 +15,21 @@ describe "Checkout" do
|
|
15
15
|
stock_location.stock_items.update_all(count_on_hand: 1)
|
16
16
|
end
|
17
17
|
|
18
|
+
describe 'errors messages', js: true do
|
19
|
+
before(:each) do
|
20
|
+
Spree::Config[:ship_address_has_cpf] = true
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'has a valid error message regarding CPF field' do
|
24
|
+
add_mug_and_checkout
|
25
|
+
fill_in_address type: 'bill', cpf: 'invalid cpf', fill_cpf: true
|
26
|
+
click_button "Save and Continue"
|
27
|
+
|
28
|
+
page.should have_content 'Bill address CPF is invalid'
|
29
|
+
page.should have_content 'Ship address CPF is invalid'
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
18
33
|
context "full checkout", js: true do
|
19
34
|
before do
|
20
35
|
shipping_method.calculator.preferred_amount = 10
|
@@ -62,6 +77,7 @@ describe "Checkout" do
|
|
62
77
|
end
|
63
78
|
|
64
79
|
def fill_in_address(opts = {})
|
80
|
+
cpf = opts[:cpf] || "036.142.049-87"
|
65
81
|
type = opts[:type] || 'bill'
|
66
82
|
fill_cpf ||= opts[:fill_cpf]
|
67
83
|
|
@@ -70,7 +86,7 @@ describe "Checkout" do
|
|
70
86
|
fill_in "#{address}_lastname", :with => "Bigg"
|
71
87
|
fill_in "#{address}_address1", :with => "143 Swan Street"
|
72
88
|
fill_in "#{address}_city", :with => "Richmond"
|
73
|
-
fill_in "#{address}_cpf", :with =>
|
89
|
+
fill_in "#{address}_cpf", :with => cpf if fill_cpf
|
74
90
|
select "United States of America", :from => "#{address}_country_id"
|
75
91
|
select "Alabama", :from => "#{address}_state_id"
|
76
92
|
fill_in "#{address}_zipcode", :with => "12345"
|
data/spree_cpf.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
Gem::Specification.new do |s|
|
3
3
|
s.platform = Gem::Platform::RUBY
|
4
4
|
s.name = 'spree_cpf'
|
5
|
-
s.version = '2.1.
|
5
|
+
s.version = '2.1.7'
|
6
6
|
s.summary = 'Spree extension that adds CPF to address field'
|
7
7
|
s.description = 'Spree extension that adds CPF to address field'
|
8
8
|
s.required_ruby_version = '>= 1.9.3'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_cpf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tiago Amaro
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-01
|
11
|
+
date: 2014-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: spree_core
|
@@ -238,7 +238,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
238
238
|
requirements:
|
239
239
|
- none
|
240
240
|
rubyforge_project:
|
241
|
-
rubygems_version: 2.2.
|
241
|
+
rubygems_version: 2.2.2
|
242
242
|
signing_key:
|
243
243
|
specification_version: 4
|
244
244
|
summary: Spree extension that adds CPF to address field
|