ashmont 0.10.0 → 0.10.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 +3 -0
- data/lib/ashmont/customer.rb +12 -0
- data/lib/ashmont/version.rb +1 -1
- data/spec/ashmont/customer_spec.rb +24 -0
- 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: 6a7cfc4170ed969c9b0f588c3c8865423f6a934e
|
4
|
+
data.tar.gz: dca7956754612e0acc726d26f656bd92cd853022
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66e08c07c6a81d8b4e3ba90df0e2996cf569aacb66bfb229a24f9bb499e6b4f6f0b5497b886542c138b36b5a822d503be79ac40143586bf072f5789b24321630
|
7
|
+
data.tar.gz: 81f158042cc378817224eafda369f6b05162ba24874e2a9e9bea6e5702f26f8c37ff62201db84d3750c27783583b942b33695bca6a20bd85b2b1d46ae4d96587
|
data/CHANGELOG.md
CHANGED
data/lib/ashmont/customer.rb
CHANGED
@@ -23,6 +23,18 @@ module Ashmont
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
+
|
27
|
+
def paypal_account
|
28
|
+
paypal_accounts[0]
|
29
|
+
end
|
30
|
+
def paypal_accounts
|
31
|
+
if persisted?
|
32
|
+
remote_customer.paypal_accounts
|
33
|
+
else
|
34
|
+
[]
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
26
38
|
def has_billing_info?
|
27
39
|
credit_card.present?
|
28
40
|
end
|
data/lib/ashmont/version.rb
CHANGED
@@ -2,6 +2,30 @@ require 'spec_helper'
|
|
2
2
|
require 'ashmont/customer'
|
3
3
|
|
4
4
|
describe Ashmont::Customer do
|
5
|
+
it "returns all paypal accounts" do
|
6
|
+
token = "xyz"
|
7
|
+
remote_customer = stub("customer", :paypal_accounts => ["first", "second"])
|
8
|
+
Braintree::Customer.stubs(:find => remote_customer)
|
9
|
+
|
10
|
+
result = Ashmont::Customer.new(token).paypal_accounts
|
11
|
+
|
12
|
+
|
13
|
+
expect(Braintree::Customer).to have_received(:find).with(token)
|
14
|
+
expect(result).to eq(["first", "second"])
|
15
|
+
end
|
16
|
+
|
17
|
+
it "returns its first paypal_account" do
|
18
|
+
token = "xyz"
|
19
|
+
remote_customer = stub("customer", :paypal_accounts => ["first", "second"])
|
20
|
+
Braintree::Customer.stubs(:find => remote_customer)
|
21
|
+
|
22
|
+
result = Ashmont::Customer.new(token).paypal_account
|
23
|
+
|
24
|
+
expect(Braintree::Customer).to have_received(:find).with(token)
|
25
|
+
expect(result).to eq("first")
|
26
|
+
end
|
27
|
+
|
28
|
+
|
5
29
|
it "returns its first credit card" do
|
6
30
|
token = "xyz"
|
7
31
|
remote_customer = stub("customer", :credit_cards => ["first", "second"])
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ashmont
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- thoughtbot
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-04-
|
12
|
+
date: 2017-04-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: braintree
|