ashmont 0.10.0 → 0.10.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c280c54138a69e58a330ca560cebf4f2025e1414
4
- data.tar.gz: 7e6b3dcd1fe38801b233212f775e896056da3b86
3
+ metadata.gz: 6a7cfc4170ed969c9b0f588c3c8865423f6a934e
4
+ data.tar.gz: dca7956754612e0acc726d26f656bd92cd853022
5
5
  SHA512:
6
- metadata.gz: e0145e3239ef5134476eabb514c08a37c635ae912f603168a31b2330b3e4dcd7b89eba298cdb7237a8f6aa22f478adb7d67d556782156dc1d3b14260245fa37a
7
- data.tar.gz: '087c60a85cff163a02ab6abb54c009bd1bb1a7fd53182980c1a69d864378c679773b49ce91cd6c5bd8bfe8f85284d77da12f0f43e72b9c1980df880bf86f6ec2'
6
+ metadata.gz: 66e08c07c6a81d8b4e3ba90df0e2996cf569aacb66bfb229a24f9bb499e6b4f6f0b5497b886542c138b36b5a822d503be79ac40143586bf072f5789b24321630
7
+ data.tar.gz: 81f158042cc378817224eafda369f6b05162ba24874e2a9e9bea6e5702f26f8c37ff62201db84d3750c27783583b942b33695bca6a20bd85b2b1d46ae4d96587
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## v0.10.1
2
+ * ADDED: #paypal_account to Customer
3
+
1
4
  ##v0.10.0
2
5
  * bumped version number for gem release
3
6
 
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Ashmont
2
- VERSION = "0.10.0"
2
+ VERSION = "0.10.1"
3
3
  end
@@ -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.0
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-23 00:00:00.000000000 Z
12
+ date: 2017-04-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: braintree