lob 5.1.1 → 5.4.0

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.
Files changed (40) hide show
  1. checksums.yaml +5 -5
  2. data/.travis.yml +2 -3
  3. data/CHANGELOG.md +13 -1
  4. data/README.md +13 -0
  5. data/examples/README.md +80 -2
  6. data/examples/checks.rb +4 -3
  7. data/examples/csv_checks/create_checks.rb +3 -2
  8. data/examples/csv_letters/create_letters.rb +3 -2
  9. data/examples/csv_postcards/create_postcards.rb +3 -2
  10. data/examples/csv_verify/verify.rb +3 -2
  11. data/examples/letters.rb +3 -2
  12. data/examples/list_postcards_metadata.rb +94 -0
  13. data/examples/postcards.rb +5 -4
  14. data/examples/postcards_idempotent.rb +92 -0
  15. data/examples/postcards_intl.rb +87 -0
  16. data/examples/postcards_remote.rb +87 -0
  17. data/examples/postcards_send_date.rb +97 -0
  18. data/examples/postcards_template.rb +98 -0
  19. data/examples/self_mailers.rb +38 -0
  20. data/lib/lob/client.rb +20 -0
  21. data/lib/lob/resources/bulk_intl_verifications.rb +26 -0
  22. data/lib/lob/resources/bulk_us_verifications.rb +27 -0
  23. data/lib/lob/resources/resource_base.rb +5 -5
  24. data/lib/lob/resources/self_mailer.rb +14 -0
  25. data/lib/lob/resources/us_reverse_geocode_lookups.rb +26 -0
  26. data/lib/lob/version.rb +1 -1
  27. data/lob.gemspec +5 -3
  28. data/spec/lob/resources/bulk_intl_verifications_spec.rb +30 -0
  29. data/spec/lob/resources/bulk_us_verifications_spec.rb +37 -0
  30. data/spec/lob/resources/letter_spec.rb +1 -1
  31. data/spec/lob/resources/postcard_spec.rb +6 -6
  32. data/spec/lob/resources/resource_base_spec.rb +2 -2
  33. data/spec/lob/resources/self_mailer_spec.rb +177 -0
  34. data/spec/lob/resources/us_reverse_geocode_lookups_spec.rb +22 -0
  35. data/spec/samples/sfm-12x9-inside.pdf +0 -0
  36. data/spec/samples/sfm-12x9-outside.pdf +0 -0
  37. data/spec/samples/sfm-6x18-inside.pdf +0 -0
  38. data/spec/samples/sfm-6x18-outside.pdf +0 -0
  39. data/spec/spec_helper.rb +2 -2
  40. metadata +64 -10
@@ -0,0 +1,87 @@
1
+ $:.unshift File.expand_path("../lib", File.dirname(__FILE__))
2
+ require 'lob.rb'
3
+ require 'pp'
4
+
5
+ # initialize Lob object
6
+ lob = Lob::Client.new(api_key: 'YOUR_API_KEY')
7
+
8
+ # HTML to send to the server
9
+ html = %{
10
+ <html>
11
+ <head>
12
+ <title>Lob.com Sample 4x6 Postcard Front</title>
13
+ <style>
14
+ *, *:before, *:after {
15
+ -webkit-box-sizing: border-box;
16
+ -moz-box-sizing: border-box;
17
+ box-sizing: border-box;
18
+ }
19
+
20
+ @font-face {
21
+ font-family: 'Loved by the King';
22
+ font-style: normal;
23
+ font-weight: 400;
24
+ src: url('https://s3-us-west-2.amazonaws.com/public.lob.com/fonts/lovedByTheKing/LovedbytheKing.ttf') format('truetype');
25
+ }
26
+
27
+ body {
28
+ width: 6.25in;
29
+ height: 4.25in;
30
+ margin: 0;
31
+ padding: 0;
32
+ /* If using an image, the background image should have dimensions of 1875x1275 pixels. */
33
+ background-image: url('https://s3-us-west-2.amazonaws.com/public.lob.com/assets/beach.jpg');
34
+ background-size: 6.25in 4.25in;
35
+ background-repeat: no-repeat;
36
+ }
37
+
38
+ .text {
39
+ margin: 50px;
40
+ width: 400px;
41
+ font-family: 'Loved by the King';
42
+ font-size: 50px;
43
+ font-weight: 700;
44
+ color: white;
45
+ text-shadow: 3px 3px black;
46
+ }
47
+ </style>
48
+ </head>
49
+
50
+ <body>
51
+ <h1 class="text">Hello {{name}}!</h1>
52
+ <p class="text">Join us for the {{event}}!</p>
53
+ </body>
54
+
55
+ </html>
56
+ }
57
+
58
+ # create a to address
59
+ to_address = lob.addresses.create(
60
+ name: "ToAddress",
61
+ address_line1: "120 6th Ave",
62
+ address_city: "Boston",
63
+ address_state: "MA",
64
+ address_country: "US",
65
+ address_zip: 12345
66
+ )
67
+
68
+ # create a from address
69
+ from_address = lob.addresses.create(
70
+ name: "FromAddress",
71
+ address_line1: "120 6th Ave",
72
+ address_city: "Boston",
73
+ address_state: "MA",
74
+ address_country: "US",
75
+ address_zip: 12345
76
+ )
77
+
78
+ # send a postcard
79
+ pp lob.postcards.create(
80
+ description: "Beach Postcard",
81
+ to: to_address["id"],
82
+ from: from_address["id"],
83
+ metadata: { campaign: "Summer 2015 Beach" },
84
+ merge_variables: { name: "Albert", event: "Summer 2015 Beach-athon" },
85
+ front: 'https://s3-us-west-2.amazonaws.com/public.lob.com/assets/templates/4x6_pc_template.pdf',
86
+ back: 'https://s3-us-west-2.amazonaws.com/public.lob.com/assets/templates/4x6_pc_template.pdf'
87
+ )
@@ -0,0 +1,97 @@
1
+ $:.unshift File.expand_path("../lib", File.dirname(__FILE__))
2
+ require 'lob.rb'
3
+ require 'pp'
4
+ require 'date'
5
+
6
+ # initialize Lob object
7
+ lob = Lob::Client.new(api_key: 'YOUR_API_KEY')
8
+
9
+ # HTML to send to the server
10
+ html = %{
11
+ <html>
12
+ <head>
13
+ <title>Lob.com Sample 4x6 Postcard Front</title>
14
+ <style>
15
+ *, *:before, *:after {
16
+ -webkit-box-sizing: border-box;
17
+ -moz-box-sizing: border-box;
18
+ box-sizing: border-box;
19
+ }
20
+
21
+ @font-face {
22
+ font-family: 'Loved by the King';
23
+ font-style: normal;
24
+ font-weight: 400;
25
+ src: url('https://s3-us-west-2.amazonaws.com/public.lob.com/fonts/lovedByTheKing/LovedbytheKing.ttf') format('truetype');
26
+ }
27
+
28
+ body {
29
+ width: 6.25in;
30
+ height: 4.25in;
31
+ margin: 0;
32
+ padding: 0;
33
+ /* If using an image, the background image should have dimensions of 1875x1275 pixels. */
34
+ background-image: url('https://s3-us-west-2.amazonaws.com/public.lob.com/assets/beach.jpg');
35
+ background-size: 6.25in 4.25in;
36
+ background-repeat: no-repeat;
37
+ }
38
+
39
+ .text {
40
+ margin: 50px;
41
+ width: 400px;
42
+ font-family: 'Loved by the King';
43
+ font-size: 50px;
44
+ font-weight: 700;
45
+ color: white;
46
+ text-shadow: 3px 3px black;
47
+ }
48
+ </style>
49
+ </head>
50
+
51
+ <body>
52
+ <h1 class="text">Hello {{name}}!</h1>
53
+ <p class="text">Join us for the {{event}}!</p>
54
+ </body>
55
+
56
+ </html>
57
+ }
58
+
59
+ # create a to address
60
+ to_address = lob.addresses.create(
61
+ name: "ToAddress",
62
+ address_line1: "120 6th Ave",
63
+ address_city: "Boston",
64
+ address_state: "MA",
65
+ address_country: "US",
66
+ address_zip: 12345
67
+ )
68
+
69
+ # create a from address
70
+ from_address = lob.addresses.create(
71
+ name: "FromAddress",
72
+ address_line1: "120 6th Ave",
73
+ address_city: "Boston",
74
+ address_state: "MA",
75
+ address_country: "US",
76
+ address_zip: 12345
77
+ )
78
+
79
+ def get_date()
80
+ time = Time.new
81
+ if time.month == 12
82
+ return "#{time.year + 1}-01-#{time.day}"
83
+ else
84
+ return "#{time.year}-#{time.month + 1}-#{time.day}"
85
+ end
86
+ end
87
+
88
+ pp lob.postcards.create(
89
+ description: "Beach Postcard",
90
+ to: to_address["id"],
91
+ from: from_address["id"],
92
+ metadata: { campaign: "Summer 2015 Beach" },
93
+ merge_variables: { name: "Albert", event: "Summer 2015 Beach-athon" },
94
+ front: html,
95
+ back: "<h1>Please RSVP as soon as possible to reserve your lounge chair.</h1>",
96
+ send_date: get_date()
97
+ )
@@ -0,0 +1,98 @@
1
+ $:.unshift File.expand_path("../lib", File.dirname(__FILE__))
2
+ require 'lob.rb'
3
+ require 'pp'
4
+
5
+ # initialize Lob object
6
+ # this key is publicly available in the legacy docs, so it's hardcoded
7
+ # since the templates are associated with this dummy account
8
+ # you can replace this key with your own, and the IDs below with any
9
+ # saved templates you have
10
+ lob = Lob::Client.new(api_key: 'test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc')
11
+
12
+ # HTML to send to the server
13
+ html = %{
14
+ <html>
15
+ <head>
16
+ <title>Lob.com Sample 4x6 Postcard Front</title>
17
+ <style>
18
+ *, *:before, *:after {
19
+ -webkit-box-sizing: border-box;
20
+ -moz-box-sizing: border-box;
21
+ box-sizing: border-box;
22
+ }
23
+
24
+ @font-face {
25
+ font-family: 'Loved by the King';
26
+ font-style: normal;
27
+ font-weight: 400;
28
+ src: url('https://s3-us-west-2.amazonaws.com/public.lob.com/fonts/lovedByTheKing/LovedbytheKing.ttf') format('truetype');
29
+ }
30
+
31
+ body {
32
+ width: 6.25in;
33
+ height: 4.25in;
34
+ margin: 0;
35
+ padding: 0;
36
+ /* If using an image, the background image should have dimensions of 1875x1275 pixels. */
37
+ background-image: url('https://s3-us-west-2.amazonaws.com/public.lob.com/assets/beach.jpg');
38
+ background-size: 6.25in 4.25in;
39
+ background-repeat: no-repeat;
40
+ }
41
+
42
+ .text {
43
+ margin: 50px;
44
+ width: 400px;
45
+ font-family: 'Loved by the King';
46
+ font-size: 50px;
47
+ font-weight: 700;
48
+ color: white;
49
+ text-shadow: 3px 3px black;
50
+ }
51
+ </style>
52
+ </head>
53
+
54
+ <body>
55
+ <h1 class="text">Hello {{name}}!</h1>
56
+ <p class="text">Join us for the {{event}}!</p>
57
+ </body>
58
+
59
+ </html>
60
+ }
61
+
62
+ # create a to address
63
+ to_address = lob.addresses.create(
64
+ {
65
+ "name": "ToAddress",
66
+ "address_line1": "120 6th Ave",
67
+ "address_city": "Boston",
68
+ "address_state": "MA",
69
+ "address_country": "US",
70
+ "address_zip": 12345
71
+ }
72
+ )
73
+
74
+ # create a from address
75
+ from_address = lob.addresses.create(
76
+ {
77
+ "name": "FromAddress",
78
+ "address_line1": "120 6th Ave",
79
+ "address_city": "Boston",
80
+ "address_state": "MA",
81
+ "address_country": "US",
82
+ "address_zip": 12345
83
+ }
84
+ )
85
+
86
+ # send a postcard
87
+ pp lob.postcards.create(
88
+ {
89
+ "description": "Beach Postcard",
90
+ "to": to_address["id"],
91
+ "from": from_address["id"],
92
+ "metadata": { campaign: "Summer 2015 Beach" },
93
+ "merge_variables": { name: "Albert", event: "Summer 2015 Beach-athon" },
94
+ # you can replace these template IDs
95
+ "front": 'tmpl_b846a20859ae11a',
96
+ "back": 'tmpl_01b0d396a10c268'
97
+ }
98
+ )
@@ -0,0 +1,38 @@
1
+ $:.unshift File.expand_path("../lib", File.dirname(__FILE__))
2
+ require 'lob'
3
+ require 'pp'
4
+
5
+ # initialize Lob object
6
+ lob = Lob::Client.new(api_key: 'YOUR_API_KEY')
7
+
8
+ # create a to address
9
+ to_address = lob.addresses.create(
10
+ name: "ToAddress",
11
+ address_line1: "120 6th Ave",
12
+ address_city: "Boston",
13
+ address_state: "MA",
14
+ address_country: "US",
15
+ address_zip: 12345
16
+ )
17
+
18
+ # create a from address
19
+ from_address = lob.addresses.create(
20
+ name: "FromAddress",
21
+ address_line1: "120 6th Ave",
22
+ address_city: "Boston",
23
+ address_state: "MA",
24
+ address_country: "US",
25
+ address_zip: 12345
26
+ )
27
+
28
+
29
+ # send a self mailer
30
+ pp lob.self_mailers.create(
31
+ description: "Beach Postcard",
32
+ to: to_address["id"],
33
+ from: from_address["id"],
34
+ metadata: { campaign: "Summer 2021 Beach" },
35
+ merge_variables: { name: "Albert" },
36
+ outside: "https://s3-us-west-2.amazonaws.com/public.lob.com/assets/templates/self_mailers/6x18_sfm_outside.pdf",
37
+ inside: "<h1>Hi {{name}}, please RSVP as soon as possible to reserve your lounge chair.</h1>"
38
+ )
data/lib/lob/client.rb CHANGED
@@ -1,12 +1,16 @@
1
1
  require "lob/resources/address"
2
2
  require "lob/resources/bank_account"
3
+ require "lob/resources/bulk_intl_verifications"
4
+ require "lob/resources/bulk_us_verifications"
3
5
  require "lob/resources/check"
4
6
  require "lob/resources/group"
5
7
  require "lob/resources/groups_member"
6
8
  require "lob/resources/intl_verifications"
7
9
  require "lob/resources/letter"
8
10
  require "lob/resources/postcard"
11
+ require "lob/resources/self_mailer"
9
12
  require "lob/resources/us_autocompletions"
13
+ require "lob/resources/us_reverse_geocode_lookups"
10
14
  require "lob/resources/us_verifications"
11
15
  require "lob/resources/us_zip_lookups"
12
16
 
@@ -31,6 +35,14 @@ module Lob
31
35
  Lob::Resources::BankAccount.new(config)
32
36
  end
33
37
 
38
+ def bulk_intl_verifications
39
+ Lob::Resources::BulkIntlVerifications.new(config)
40
+ end
41
+
42
+ def bulk_us_verifications
43
+ Lob::Resources::BulkUSVerifications.new(config)
44
+ end
45
+
34
46
  def checks
35
47
  Lob::Resources::Check.new(config)
36
48
  end
@@ -55,10 +67,18 @@ module Lob
55
67
  Lob::Resources::Postcard.new(config)
56
68
  end
57
69
 
70
+ def self_mailers
71
+ Lob::Resources::SelfMailer.new(config)
72
+ end
73
+
58
74
  def us_autocompletions
59
75
  Lob::Resources::USAutocompletions.new(config)
60
76
  end
61
77
 
78
+ def us_reverse_geocode_lookups
79
+ Lob::Resources::USReverseGeocodeLookups.new(config)
80
+ end
81
+
62
82
  def us_verifications
63
83
  Lob::Resources::USVerifications.new(config)
64
84
  end
@@ -0,0 +1,26 @@
1
+ require "lob/resources/resource_base"
2
+
3
+ module Lob
4
+ module Resources
5
+ class BulkIntlVerifications < Lob::Resources::ResourceBase
6
+
7
+ undef_method :list, :find, :create, :destroy
8
+
9
+ def initialize(config)
10
+ super(config)
11
+ @endpoint = "bulk/intl_verifications"
12
+ end
13
+
14
+ def verify(body={})
15
+ request = {
16
+ method: :post,
17
+ url: endpoint_url,
18
+ body: body
19
+ }
20
+
21
+ submit request
22
+ end
23
+
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,27 @@
1
+ require "lob/resources/resource_base"
2
+
3
+ module Lob
4
+ module Resources
5
+ class BulkUSVerifications < Lob::Resources::ResourceBase
6
+
7
+ undef_method :list, :find, :create, :destroy
8
+
9
+ def initialize(config)
10
+ super(config)
11
+ @endpoint = "bulk/us_verifications"
12
+ end
13
+
14
+ def verify(body={}, query={})
15
+ request = {
16
+ method: :post,
17
+ url: endpoint_url,
18
+ body: body,
19
+ query: query
20
+ }
21
+
22
+ submit request
23
+ end
24
+
25
+ end
26
+ end
27
+ end
@@ -19,7 +19,7 @@ module Lob
19
19
  query: query
20
20
  }
21
21
 
22
- submit request
22
+ submit(request)
23
23
  end
24
24
 
25
25
  def find(resource_id)
@@ -28,7 +28,7 @@ module Lob
28
28
  url: resource_url(resource_id)
29
29
  }
30
30
 
31
- submit request
31
+ submit(request)
32
32
  end
33
33
 
34
34
  def create(body={}, headers={}, query={})
@@ -40,7 +40,7 @@ module Lob
40
40
  query: query
41
41
  }
42
42
 
43
- submit request
43
+ submit(request)
44
44
  end
45
45
 
46
46
  def destroy(resource_id)
@@ -49,7 +49,7 @@ module Lob
49
49
  url: resource_url(resource_id)
50
50
  }
51
51
 
52
- submit request
52
+ submit(request)
53
53
  end
54
54
 
55
55
  private
@@ -71,7 +71,7 @@ module Lob
71
71
  if query != {}
72
72
  url = "#{url}?#{build_nested_query(query)}"
73
73
  end
74
-
74
+
75
75
  begin
76
76
  if method == :get || method == :delete
77
77
  response = RestClient.send(method, url, headers)
@@ -0,0 +1,14 @@
1
+ require "lob/resources/resource_base"
2
+
3
+ module Lob
4
+ module Resources
5
+ class SelfMailer < Lob::Resources::ResourceBase
6
+
7
+ def initialize(config)
8
+ super(config)
9
+ @endpoint = "self_mailers"
10
+ end
11
+
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,26 @@
1
+ require "lob/resources/resource_base"
2
+
3
+ module Lob
4
+ module Resources
5
+ class USReverseGeocodeLookups < Lob::Resources::ResourceBase
6
+
7
+ undef_method :list, :find, :create, :destroy
8
+
9
+ def initialize(config)
10
+ super(config)
11
+ @endpoint = "us_reverse_geocode_lookups"
12
+ end
13
+
14
+ def lookup(body={})
15
+ request = {
16
+ method: :post,
17
+ url: endpoint_url,
18
+ body: body
19
+ }
20
+
21
+ submit request
22
+ end
23
+
24
+ end
25
+ end
26
+ end
data/lib/lob/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lob
2
- VERSION = "5.1.1"
2
+ VERSION = "5.4.0"
3
3
  end
data/lob.gemspec CHANGED
@@ -20,9 +20,11 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_dependency "rest-client", ">= 2.0.1", "< 3.0"
22
22
 
23
- spec.add_development_dependency "rake", "~> 10.4.2"
23
+ spec.add_development_dependency "rake", "~> 12.3.3"
24
24
  spec.add_development_dependency "minitest", "~> 5.6.1"
25
25
  spec.add_development_dependency "webmock", "~> 1.2"
26
- spec.add_development_dependency "coveralls", "~> 0.8.13"
27
- spec.add_development_dependency "simplecov", "~> 0.11.0"
26
+ spec.add_development_dependency "coveralls", "~> 0.8.23"
27
+ spec.add_development_dependency "simplecov", "~> 0.16.1"
28
+ spec.add_development_dependency "json", "~> 2.3.1"
29
+ spec.add_development_dependency "uri", "~> 0.10.1"
28
30
  end
@@ -0,0 +1,30 @@
1
+ require "spec_helper"
2
+
3
+ describe Lob::Resources::BulkIntlVerifications do
4
+
5
+ before :each do
6
+ @sample_params = {
7
+ addresses: [
8
+ {
9
+ primary_line: "123 Test St",
10
+ city: "HEARST",
11
+ state: "ONTARIO",
12
+ postal_code: "P0L1N0",
13
+ country: "CA"
14
+ }
15
+ ]
16
+ }
17
+ end
18
+
19
+ subject { Lob::Client.new(api_key: API_KEY) }
20
+
21
+ describe "verify" do
22
+ it "should verify an international address" do
23
+ result = subject.bulk_intl_verifications.verify @sample_params
24
+ addresses = result["addresses"]
25
+ address = addresses.first
26
+ address["recipient"].must_equal("TEST KEYS DO NOT VERIFY ADDRESSES")
27
+ end
28
+ end
29
+
30
+ end
@@ -0,0 +1,37 @@
1
+ require "spec_helper"
2
+
3
+ describe Lob::Resources::BulkUSVerifications do
4
+
5
+ before :each do
6
+ @sample_params = {
7
+ addresses: [
8
+ {
9
+ recipient: "LOB.COM",
10
+ primary_line: "185 BERRY ST STE 6600",
11
+ city: "SAN FRANCISCO",
12
+ state: "CA",
13
+ zip_code: "94107"
14
+ }
15
+ ]
16
+ }
17
+ end
18
+
19
+ subject { Lob::Client.new(api_key: API_KEY) }
20
+
21
+ describe "verify" do
22
+ it "should verify a US address" do
23
+ result = subject.bulk_us_verifications.verify @sample_params
24
+ addresses = result["addresses"]
25
+ address = addresses.first
26
+ address["recipient"].must_equal("TEST KEYS DO NOT VERIFY ADDRESSES")
27
+ end
28
+
29
+ it "should allow 'case' in query params" do
30
+ result = subject.bulk_us_verifications.verify @sample_params, {case: "proper"}
31
+ addresses = result["addresses"]
32
+ address = addresses.first
33
+ address["recipient"].must_equal("Test Keys Do Not Verify Addresses")
34
+ end
35
+ end
36
+
37
+ end
@@ -88,7 +88,7 @@ describe Lob::Resources::Letter do
88
88
  )
89
89
 
90
90
  result = subject.letters.find(new_letter["id"])
91
- assert /#{new_letter["description"]}/ =~ result.to_s
91
+ assert %r{#{new_letter["description"]}} =~ result.to_s
92
92
  end
93
93
  end
94
94
 
@@ -37,7 +37,7 @@ describe Lob::Resources::Postcard do
37
37
  description: @sample_postcard_params[:description],
38
38
  to: new_address["id"],
39
39
  back: @sample_postcard_params[:back],
40
- front: "https://lob.com/postcardfront.pdf"
40
+ front: "https://s3-us-west-2.amazonaws.com/public.lob.com/assets/pc_4x6_front.pdf"
41
41
  )
42
42
 
43
43
  result["description"].must_equal(@sample_postcard_params[:description])
@@ -48,7 +48,7 @@ describe Lob::Resources::Postcard do
48
48
  description: @sample_postcard_params[:description],
49
49
  to: @sample_address_params,
50
50
  back: @sample_postcard_params[:back],
51
- front: "https://lob.com/postcardfront.pdf"
51
+ front: "https://s3-us-west-2.amazonaws.com/public.lob.com/assets/pc_4x6_front.pdf"
52
52
  )
53
53
 
54
54
  result["description"].must_equal(@sample_postcard_params[:description])
@@ -62,7 +62,7 @@ describe Lob::Resources::Postcard do
62
62
  to: new_address["id"],
63
63
  from: @sample_address_params,
64
64
  back: @sample_postcard_params[:back],
65
- front: "https://lob.com/postcardfront.pdf"
65
+ front: "https://s3-us-west-2.amazonaws.com/public.lob.com/assets/pc_4x6_front.pdf"
66
66
  )
67
67
 
68
68
  result["description"].must_equal(@sample_postcard_params[:description])
@@ -74,8 +74,8 @@ describe Lob::Resources::Postcard do
74
74
  result = subject.postcards.create(
75
75
  description: @sample_postcard_params[:description],
76
76
  to: new_address["id"],
77
- front: "https://lob.com/postcardfront.pdf",
78
- back: "https://lob.com/postcardback.pdf"
77
+ front: "https://s3-us-west-2.amazonaws.com/public.lob.com/assets/pc_4x6_front.pdf",
78
+ back: "https://s3-us-west-2.amazonaws.com/public.lob.com/assets/pc_4x6_back.pdf"
79
79
  )
80
80
 
81
81
  result["description"].must_equal(@sample_postcard_params[:description])
@@ -112,7 +112,7 @@ describe Lob::Resources::Postcard do
112
112
  description: @sample_postcard_params[:description],
113
113
  to: new_address["id"],
114
114
  back: "<html>{{#list}} {{name}} {{/list}}</html>",
115
- front: "https://lob.com/postcardfront.pdf",
115
+ front: "https://s3-us-west-2.amazonaws.com/public.lob.com/assets/pc_4x6_front.pdf",
116
116
  merge_variables: merge_variables
117
117
  )
118
118
 
@@ -55,7 +55,7 @@ describe Lob::Resources::ResourceBase do
55
55
  description: sample_postcard_params[:description],
56
56
  to: new_address["id"],
57
57
  back: sample_postcard_params[:back],
58
- front: "https://lob.com/postcardfront.pdf"
58
+ front: "https://s3-us-west-2.amazonaws.com/public.lob.com/assets/pc_4x6_front.pdf"
59
59
  }, {
60
60
  "Idempotency-Key" => idempotency_key
61
61
  })
@@ -64,7 +64,7 @@ describe Lob::Resources::ResourceBase do
64
64
  description: sample_postcard_params[:description],
65
65
  to: new_address["id"],
66
66
  back: sample_postcard_params[:back],
67
- front: "https://lob.com/postcardfront.pdf"
67
+ front: "https://s3-us-west-2.amazonaws.com/public.lob.com/assets/pc_4x6_front.pdf"
68
68
  }, {
69
69
  "Idempotency-Key" => idempotency_key
70
70
  })