facebook_ads 0.1.11 → 0.1.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/.approvals +0 -0
  3. data/.coveralls.yml +1 -0
  4. data/.rspec +2 -0
  5. data/.rubocop.yml +13 -1
  6. data/.rubocop_todo.yml +16 -0
  7. data/.travis.yml +3 -1
  8. data/CHANGELOG.md +5 -0
  9. data/Gemfile +10 -7
  10. data/Gemfile.lock +56 -19
  11. data/LICENSE.md +22 -0
  12. data/README.md +8 -0
  13. data/facebook_ads.gemspec +2 -2
  14. data/lib/facebook_ads/ad.rb +2 -2
  15. data/lib/facebook_ads/ad_account.rb +52 -19
  16. data/lib/facebook_ads/ad_audience.rb +1 -1
  17. data/lib/facebook_ads/ad_campaign.rb +47 -5
  18. data/lib/facebook_ads/ad_creative.rb +4 -4
  19. data/lib/facebook_ads/ad_exception.rb +7 -1
  20. data/lib/facebook_ads/ad_image.rb +6 -2
  21. data/lib/facebook_ads/ad_insight.rb +1 -1
  22. data/lib/facebook_ads/ad_product.rb +1 -1
  23. data/lib/facebook_ads/ad_product_catalog.rb +1 -1
  24. data/lib/facebook_ads/ad_product_feed.rb +1 -1
  25. data/lib/facebook_ads/ad_product_set.rb +1 -1
  26. data/lib/facebook_ads/ad_set.rb +5 -5
  27. data/lib/facebook_ads/ad_targeting.rb +3 -3
  28. data/lib/facebook_ads/base.rb +10 -9
  29. data/spec/facebook_ads/ad_account_spec.rb +93 -0
  30. data/spec/facebook_ads/ad_campaign_spec.rb +19 -0
  31. data/spec/facebook_ads/ad_creative_spec.rb +4 -0
  32. data/spec/facebook_ads/ad_image_spec.rb +4 -0
  33. data/spec/facebook_ads/ad_insight_spec.rb +4 -0
  34. data/spec/facebook_ads/ad_product_catalog_spec.rb +27 -0
  35. data/spec/facebook_ads/ad_product_feed_spec.rb +4 -0
  36. data/spec/facebook_ads/ad_product_set_spec.rb +4 -0
  37. data/spec/facebook_ads/ad_product_spec.rb +21 -0
  38. data/spec/facebook_ads/ad_set_spec.rb +47 -0
  39. data/spec/facebook_ads/ad_spec.rb +4 -0
  40. data/spec/facebook_ads/ad_targeting_spec.rb +4 -0
  41. data/spec/facebook_ads/facebook_ads_spec.rb +15 -0
  42. data/spec/fixtures/approvals/facebookads_adaccount/ad_campaigns/lists_campaigns.approved.json +15 -0
  43. data/spec/fixtures/approvals/facebookads_adaccount/ad_creatives/lists_creatives.approved.json +1047 -0
  44. data/spec/fixtures/approvals/facebookads_adaccount/ad_images/lists_images.approved.json +11 -0
  45. data/spec/fixtures/approvals/facebookads_adaccount/ad_sets/lists_ad_sets.approved.json +3 -0
  46. data/spec/fixtures/approvals/facebookads_adaccount/ads/lists_ads.approved.json +3 -0
  47. data/spec/fixtures/approvals/facebookads_adaccount/all/lists_all_accounts.approved.json +92 -0
  48. data/spec/fixtures/approvals/facebookads_adaccount/create_ad_campaign/creates_a_new_ad_campaign.approved.json +13 -0
  49. data/spec/fixtures/approvals/facebookads_adaccount/create_ad_images/creates_an_image.approved.json +11 -0
  50. data/spec/fixtures/approvals/facebookads_adaccount/find_by/finds_a_specific_account.approved.json +9 -0
  51. data/spec/fixtures/approvals/facebookads_adaccount/reach_estimate/estimates_the_reach_of_a_targeting_spec.approved.json +358 -0
  52. data/spec/fixtures/cassettes/FacebookAds_AdAccount/_ad_campaigns/lists_campaigns.yml +56 -0
  53. data/spec/fixtures/cassettes/FacebookAds_AdAccount/_ad_creatives/lists_creatives.yml +91 -0
  54. data/spec/fixtures/cassettes/FacebookAds_AdAccount/_ad_images/lists_images.yml +56 -0
  55. data/spec/fixtures/cassettes/FacebookAds_AdAccount/_ad_sets/lists_ad_sets.yml +56 -0
  56. data/spec/fixtures/cassettes/FacebookAds_AdAccount/_ads/lists_ads.yml +56 -0
  57. data/spec/fixtures/cassettes/FacebookAds_AdAccount/_all/lists_all_accounts.yml +58 -0
  58. data/spec/fixtures/cassettes/FacebookAds_AdAccount/_create_ad_campaign/creates_a_new_ad_campaign.yml +115 -0
  59. data/spec/fixtures/cassettes/FacebookAds_AdAccount/_create_ad_images/creates_an_image.yml +2865 -0
  60. data/spec/fixtures/cassettes/FacebookAds_AdAccount/_find_by/finds_a_specific_account.yml +58 -0
  61. data/spec/fixtures/cassettes/FacebookAds_AdAccount/_reach_estimate/estimates_the_reach_of_a_targeting_spec.yml +56 -0
  62. data/spec/fixtures/cassettes/FacebookAds_AdCampaign/_destroy/creates_a_new_ad_campaign.yml +164 -0
  63. data/spec/spec_helper.rb +7 -0
  64. data/spec/support/approvals.rb +10 -0
  65. data/spec/support/facebook_ads.rb +4 -0
  66. data/spec/support/rest_client.rb +13 -0
  67. data/spec/support/vcr.rb +16 -0
  68. metadata +47 -29
  69. data/test/ad_account_test.rb +0 -27
  70. data/test/ad_campaign_test.rb +0 -32
  71. data/test/ad_creative_test.rb +0 -7
  72. data/test/ad_image_test.rb +0 -27
  73. data/test/ad_insight_test.rb +0 -7
  74. data/test/ad_product_catalog_test.rb +0 -28
  75. data/test/ad_product_feed_test.rb +0 -7
  76. data/test/ad_product_set_test.rb +0 -7
  77. data/test/ad_product_test.rb +0 -22
  78. data/test/ad_set_test.rb +0 -48
  79. data/test/ad_targeting_test.rb +0 -7
  80. data/test/ad_test.rb +0 -7
  81. data/test/facebook_ads_test.rb +0 -8
  82. data/test/test_helper.rb +0 -64
  83. data/test/vcr_cassettes/AdAccountTest-test_all.yml +0 -70
  84. data/test/vcr_cassettes/AdAccountTest-test_applications.yml +0 -130
  85. data/test/vcr_cassettes/AdAccountTest-test_find_by.yml +0 -71
  86. data/test/vcr_cassettes/AdCampaignTest-test_create.yml +0 -295
  87. data/test/vcr_cassettes/AdCampaignTest-test_list.yml +0 -133
  88. data/test/vcr_cassettes/AdImageTest-test_create.yml +0 -2963
  89. data/test/vcr_cassettes/AdImageTest-test_list.yml +0 -137
  90. data/test/vcr_cassettes/AdProductCatalogTest-test_all.yml +0 -60
  91. data/test/vcr_cassettes/AdProductCatalogTest-test_create.yml +0 -256
  92. data/test/vcr_cassettes/AdProductTest-test_list.yml +0 -130
  93. data/test/vcr_cassettes/AdSetTest-test_create.yml +0 -189
  94. data/test/vcr_cassettes/AdSetTest-test_destroy.yml +0 -124
  95. data/test/vcr_cassettes/AdSetTest-test_update.yml +0 -134
@@ -0,0 +1,58 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://graph.facebook.com/v2.8/me/adaccounts?access_token=<access_token>&fields=id,account_id,account_status,age,created_time,currency,name
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/json
12
+ Accept-Encoding:
13
+ - identity
14
+ User-Agent:
15
+ - rest-client/2.0.2 (darwin16.3.0 x86_64) ruby/2.2.6p396
16
+ Host:
17
+ - graph.facebook.com
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Access-Control-Allow-Origin:
24
+ - "*"
25
+ Etag:
26
+ - '"a440530e21aad047aacd9ac5e04ed08e34c7a70a"'
27
+ Pragma:
28
+ - no-cache
29
+ Cache-Control:
30
+ - private, no-cache, no-store, must-revalidate
31
+ X-Fb-Rev:
32
+ - '2980367'
33
+ Content-Type:
34
+ - application/json
35
+ X-Fb-Trace-Id:
36
+ - CuRn+gsmX/Q
37
+ Facebook-Api-Version:
38
+ - v2.8
39
+ Expires:
40
+ - Sat, 01 Jan 2000 00:00:00 GMT
41
+ Vary:
42
+ - Accept-Encoding
43
+ X-Fb-Debug:
44
+ - 9utpRUbG9ICZW5hnS7dbXWosFzJPjLK1+/CNynZedtoXzK7FUYFAsilNdJHTdB0vRmOJyKYsKOFEL7jR8mceRQ==
45
+ Date:
46
+ - Wed, 26 Apr 2017 00:48:40 GMT
47
+ Connection:
48
+ - keep-alive
49
+ Content-Length:
50
+ - '1893'
51
+ body:
52
+ encoding: UTF-8
53
+ string: '{"data":[{"id":"act_1223529531023664","account_id":"1223529531023664","account_status":1,"age":141.15273148148,"created_time":"2016-12-02T10:50:57-0800","currency":"USD","name":"International
54
+ II"},{"id":"act_1198305280212756","account_id":"1198305280212756","account_status":1,"age":159.1747337963,"created_time":"2016-11-10T13:50:54-0800","currency":"USD","name":"Retargeting"},{"id":"act_1183122141731070","account_id":"1183122141731070","account_status":1,"age":179.92611111111,"created_time":"2016-10-27T10:55:59-0700","currency":"USD","name":"DollarStart"},{"id":"act_1132789356764349","account_id":"1132789356764349","account_status":1,"age":232.91157407407,"created_time":"2016-08-31T15:14:23-0700","currency":"USD","name":"LuxeJoy"},{"id":"act_1115226431853975","account_id":"1115226431853975","account_status":1,"age":256.05325231481,"created_time":"2016-08-10T17:27:49-0700","currency":"USD","name":"Ruby"},{"id":"act_953255011384452","account_id":"953255011384452","account_status":1,"age":546.76849537037,"created_time":"2015-10-26T09:23:16-0700","currency":"USD","name":"International"},{"id":"act_1051938118182807","account_id":"1051938118182807","account_status":1,"age":361.89405092593,"created_time":"2016-04-28T17:32:07-0700","currency":"USD","name":"Web"},{"id":"act_861827983860489","account_id":"861827983860489","account_status":1,"age":743.01085648148,"created_time":"2015-04-09T16:54:58-0700","currency":"USD","name":"Android"},{"id":"act_39788579","account_id":"39788579","account_status":1,"age":2973.0627199074,"created_time":"2009-03-05T15:04:59-0800","currency":"USD","name":"iOS"},{"id":"act_10152335766987003","account_id":"10152335766987003","account_status":1,"age":466.70608796296,"created_time":"2014-10-24T14:38:31-0700","currency":"USD","name":"Chris
55
+ Estreich"}],"paging":{"cursors":{"before":"MjM4NDI1MjkxNDU2NTAyMTcZD","after":"NjAxODA5MTU2MDA0MgZDZD"}}}'
56
+ http_version:
57
+ recorded_at: Wed, 26 Apr 2017 00:48:40 GMT
58
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,56 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://graph.facebook.com/v2.8/act_10152335766987003/reachestimate?access_token=<access_token>&currency=USD&optimize_for=OFFSITE_CONVERSIONS&targeting_spec=%7B%22genders%22:%5B2%5D,%22age_min%22:18,%22age_max%22:20,%22geo_locations%22:%7B%22countries%22:%5B%22US%22%5D%7D%7D
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/json
12
+ Accept-Encoding:
13
+ - identity
14
+ User-Agent:
15
+ - rest-client/2.0.2 (darwin16.3.0 x86_64) ruby/2.2.6p396
16
+ Host:
17
+ - graph.facebook.com
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Access-Control-Allow-Origin:
24
+ - "*"
25
+ Etag:
26
+ - '"1b6f7b19201f5467d7dd9309a93b532e258f049b"'
27
+ Pragma:
28
+ - no-cache
29
+ Cache-Control:
30
+ - private, no-cache, no-store, must-revalidate
31
+ X-Fb-Rev:
32
+ - '2980367'
33
+ Content-Type:
34
+ - application/json
35
+ X-Fb-Trace-Id:
36
+ - CkopL2tG9bb
37
+ Facebook-Api-Version:
38
+ - v2.8
39
+ Expires:
40
+ - Sat, 01 Jan 2000 00:00:00 GMT
41
+ Vary:
42
+ - Accept-Encoding
43
+ X-Fb-Debug:
44
+ - vl67PMHi+Bxkp0+djDWWT4x40wNQ1s2WGeymRGEj2wNj+JhIm912g45Wt/lRPAwrP27Zur0Tfp3wqiIlbuGzAg==
45
+ Date:
46
+ - Wed, 26 Apr 2017 01:15:27 GMT
47
+ Connection:
48
+ - keep-alive
49
+ Content-Length:
50
+ - '5372'
51
+ body:
52
+ encoding: UTF-8
53
+ string: '{"data":{"users":7800000,"bid_estimations":[{"unsupported":false,"location":3,"reach_min":0,"reach_max":0,"cpm_curve_data":"","cpc_curve_data":"","cpa_curve_data":"","dedup_winning_rate":0,"dedup_status":0,"pacing_status":0,"account_budget":150000,"estimate_DAU":0,"curve":[{"bid":0,"spend":0,"reach":0,"impressions":0,"actions":0},{"bid":1,"spend":274,"reach":665.35523611293,"impressions":827.9031969689,"actions":1.844446952004},{"bid":2,"spend":526,"reach":1163.1983230804,"impressions":1498.1938839748,"actions":3.3097915123364},{"bid":2,"spend":663,"reach":1449.9428012725,"impressions":1965.3471118416,"actions":3.8865028313425},{"bid":4,"spend":812,"reach":1723.4117950617,"impressions":2473.5614735407,"actions":4.4628495280986},{"bid":5,"spend":936,"reach":1900.1942347956,"impressions":2851.3396208895,"actions":4.8916792752631},{"bid":8,"spend":1125,"reach":2112.2675174642,"impressions":3141.0211175368,"actions":5.4835039900258},{"bid":10,"spend":1298,"reach":2305.049580969,"impressions":3367.1317720084,"actions":5.730963529418},{"bid":15,"spend":1934,"reach":3230.5069725617,"impressions":4310.4008024568,"actions":6.4202204250965},{"bid":22,"spend":3238,"reach":4999.4757279719,"impressions":6152.5432742153,"actions":7.1834806443477},{"bid":27,"spend":4299,"reach":6533.721313125,"impressions":7699.448129965,"actions":8.6054391349527},{"bid":40,"spend":7899,"reach":11871.078977638,"impressions":13548.856717159,"actions":11.27562137411},{"bid":47,"spend":9490,"reach":14582.158446565,"impressions":16569.386121142,"actions":13.314717583351},{"bid":57,"spend":11723,"reach":17587.530425269,"impressions":21303.883577031,"actions":15.766131666688},{"bid":84,"spend":14431,"reach":21432.209480504,"impressions":26061.214471774,"actions":19.406462787096},{"bid":101,"spend":16022,"reach":24525.142003591,"impressions":29660.727503464,"actions":21.54425609427},{"bid":122,"spend":17700,"reach":26828.58937358,"impressions":31967.399503751,"actions":23.799962200198},{"bid":147,"spend":19628,"reach":30175.23244102,"impressions":35314.042571191,"actions":26.392152620471},{"bid":177,"spend":21694,"reach":32092.16258664,"impressions":37230.972716811,"actions":29.168515834035},{"bid":213,"spend":23596,"reach":34888.910126101,"impressions":40027.720256271,"actions":31.725230576813},{"bid":256,"spend":24939,"reach":36131.724236534,"impressions":41270.534366704,"actions":33.531023721496},{"bid":308,"spend":26186,"reach":37283.80781754,"impressions":42422.61794771,"actions":35.205910114206},{"bid":370,"spend":27383,"reach":37905.607606266,"impressions":43044.417736436,"actions":36.814312335639},{"bid":444,"spend":28499,"reach":38405.557187601,"impressions":43544.367317772,"actions":38.313739084408},{"bid":533,"spend":29698,"reach":39546.688281769,"impressions":44685.49841194,"actions":39.656810833811},{"bid":640,"spend":31184,"reach":41472.249614977,"impressions":46611.059745148,"actions":41.373272371441},{"bid":922,"spend":35827,"reach":48391.963932271,"impressions":53530.774062441,"actions":45.075853954274},{"bid":1107,"spend":39709,"reach":53747.037689427,"impressions":58885.847819598,"actions":49.489685866067},{"bid":1329,"spend":45179,"reach":60060.430481269,"impressions":65753.059986957,"actions":54.267655742793},{"bid":1595,"spend":53180,"reach":69786.743584613,"impressions":77317.033425851,"actions":62.359947825847},{"bid":1913,"spend":65276,"reach":84784.720400015,"impressions":95873.895875409,"actions":66.960827621477},{"bid":2297,"spend":81863,"reach":103041.98891234,"impressions":120697.15260441,"actions":77.269757936654},{"bid":3309,"spend":136501,"reach":167574.26626847,"impressions":189994.57016726,"actions":90.860754621151},{"bid":3971,"spend":182286,"reach":222048.88406388,"impressions":254973.91945963,"actions":109.32189156425},{"bid":4766,"spend":246337,"reach":299776.66361403,"impressions":342712.47277228,"actions":138.64450516775},{"bid":5719,"spend":341398,"reach":386588.9015888,"impressions":461779.5253937,"actions":181.37754407679},{"bid":6864,"spend":478510,"reach":496931.95796472,"impressions":607707.7247427,"actions":231.49943408876},{"bid":8237,"spend":676355,"reach":619538.42237559,"impressions":751645.34682434,"actions":274.9990270277},{"bid":9885,"spend":960405,"reach":748467.48474108,"impressions":928066.97109742,"actions":325.35941461337},{"bid":11862,"spend":1369167,"reach":928642.86327858,"impressions":1170092.1075589,"actions":360.04107458364},{"bid":14235,"spend":1957798,"reach":1178959.5945031,"impressions":1516323.3647044,"actions":409.85606432875},{"bid":17082,"spend":2806068,"reach":1371791.0770766,"impressions":1935441.7757471,"actions":485.28413349418},{"bid":20499,"spend":4028534,"reach":1496482.3840336,"impressions":2129988.0253193,"actions":514.5642743302},{"bid":24599,"spend":5790336,"reach":1539483.8268748,"impressions":2236800.8704945,"actions":538.37829905621},{"bid":29519,"spend":8273482,"reach":1551605.2113853,"impressions":2248922.2550049,"actions":554.45306018194},{"bid":35423,"spend":11576398,"reach":1551605.2113853,"impressions":2248922.2550049,"actions":562.93342303933},{"bid":40000,"spend":14647415,"reach":1551605.2113853,"impressions":2248922.2550049,"actions":562.93342303933}],"trace_id":"3bb7e83531ec9904bbb97953c7ab58b6","is_curve_eligible":false,"bid_amount_min":1172,"bid_amount_median":1495,"bid_amount_max":2014}],"estimate_ready":true}}'
54
+ http_version:
55
+ recorded_at: Wed, 26 Apr 2017 01:15:27 GMT
56
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,164 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://graph.facebook.com/v2.8/6076262142242?access_token=<access_token>&fields=id,account_id,buying_type,can_use_spend_cap,configured_status,created_time,effective_status,name,objective,start_time,stop_time,updated_time,spend_cap
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/json
12
+ Accept-Encoding:
13
+ - identity
14
+ User-Agent:
15
+ - rest-client/2.0.2 (darwin16.3.0 x86_64) ruby/2.2.6p396
16
+ Host:
17
+ - graph.facebook.com
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Access-Control-Allow-Origin:
24
+ - "*"
25
+ Etag:
26
+ - '"d25c85fbd38b6dbf3f749ab051117e8c0b4065cd"'
27
+ Pragma:
28
+ - no-cache
29
+ Cache-Control:
30
+ - private, no-cache, no-store, must-revalidate
31
+ X-Fb-Rev:
32
+ - '2980367'
33
+ Content-Type:
34
+ - application/json
35
+ X-Fb-Trace-Id:
36
+ - AhBg3GXvanL
37
+ Facebook-Api-Version:
38
+ - v2.8
39
+ Expires:
40
+ - Sat, 01 Jan 2000 00:00:00 GMT
41
+ Vary:
42
+ - Accept-Encoding
43
+ X-Fb-Debug:
44
+ - vCUeNmZV5iSQP6urNzqslAoM7fQmJlpAUwNXjrwS+DE7h9H5pHHC8tw79VjfZkxYUDJG36Cx64dA4Bl6nMB1xw==
45
+ Date:
46
+ - Wed, 26 Apr 2017 00:52:19 GMT
47
+ Connection:
48
+ - keep-alive
49
+ Content-Length:
50
+ - '335'
51
+ body:
52
+ encoding: UTF-8
53
+ string: '{"id":"6076262142242","account_id":"10152335766987003","buying_type":"AUCTION","can_use_spend_cap":true,"configured_status":"DELETED","created_time":"2017-04-25T17:34:09-0700","effective_status":"DELETED","name":"Test","objective":"MOBILE_APP_INSTALLS","start_time":"1969-12-31T15:59:59-0800","updated_time":"2017-04-25T17:35:27-0700"}'
54
+ http_version:
55
+ recorded_at: Wed, 26 Apr 2017 00:52:19 GMT
56
+ - request:
57
+ method: delete
58
+ uri: https://graph.facebook.com/v2.8/6076262142242?access_token=<access_token>
59
+ body:
60
+ encoding: US-ASCII
61
+ string: ''
62
+ headers:
63
+ Accept:
64
+ - application/json
65
+ Accept-Encoding:
66
+ - identity
67
+ User-Agent:
68
+ - rest-client/2.0.2 (darwin16.3.0 x86_64) ruby/2.2.6p396
69
+ Host:
70
+ - graph.facebook.com
71
+ response:
72
+ status:
73
+ code: 200
74
+ message: OK
75
+ headers:
76
+ P3p:
77
+ - CP="Facebook has no P3P policy fb.me/p3p"
78
+ Access-Control-Allow-Origin:
79
+ - "*"
80
+ Pragma:
81
+ - no-cache
82
+ Cache-Control:
83
+ - private, no-cache, no-store, must-revalidate
84
+ X-Fb-Rev:
85
+ - '2980367'
86
+ Content-Type:
87
+ - application/json
88
+ X-Fb-Trace-Id:
89
+ - EC9oCOuSKpv
90
+ Facebook-Api-Version:
91
+ - v2.8
92
+ Expires:
93
+ - Sat, 01 Jan 2000 00:00:00 GMT
94
+ Set-Cookie:
95
+ - sW=1493167939%3AAaD7A5PZ-V8U0XtS; path=/; domain=.graph.facebook.com; secure
96
+ Vary:
97
+ - Accept-Encoding
98
+ X-Fb-Debug:
99
+ - 4ZK97O+c7w5bW1qArx1QokwJbwrXK/0on09wSNfSXi9K1D/XMZUGgrtgNu5EKvdGpHCh3tolx6QkAcPESRH2Jw==
100
+ Date:
101
+ - Wed, 26 Apr 2017 00:52:20 GMT
102
+ Connection:
103
+ - keep-alive
104
+ Content-Length:
105
+ - '16'
106
+ body:
107
+ encoding: UTF-8
108
+ string: '{"success":true}'
109
+ http_version:
110
+ recorded_at: Wed, 26 Apr 2017 00:52:20 GMT
111
+ - request:
112
+ method: get
113
+ uri: https://graph.facebook.com/v2.8/6076262142242?access_token=<access_token>&fields=id,account_id,buying_type,can_use_spend_cap,configured_status,created_time,effective_status,name,objective,start_time,stop_time,updated_time,spend_cap
114
+ body:
115
+ encoding: US-ASCII
116
+ string: ''
117
+ headers:
118
+ Accept:
119
+ - application/json
120
+ Accept-Encoding:
121
+ - identity
122
+ User-Agent:
123
+ - rest-client/2.0.2 (darwin16.3.0 x86_64) ruby/2.2.6p396
124
+ Host:
125
+ - graph.facebook.com
126
+ response:
127
+ status:
128
+ code: 200
129
+ message: OK
130
+ headers:
131
+ Access-Control-Allow-Origin:
132
+ - "*"
133
+ Etag:
134
+ - '"d25c85fbd38b6dbf3f749ab051117e8c0b4065cd"'
135
+ Pragma:
136
+ - no-cache
137
+ Cache-Control:
138
+ - private, no-cache, no-store, must-revalidate
139
+ X-Fb-Rev:
140
+ - '2980367'
141
+ Content-Type:
142
+ - application/json
143
+ X-Fb-Trace-Id:
144
+ - GFItSlAIeCr
145
+ Facebook-Api-Version:
146
+ - v2.8
147
+ Expires:
148
+ - Sat, 01 Jan 2000 00:00:00 GMT
149
+ Vary:
150
+ - Accept-Encoding
151
+ X-Fb-Debug:
152
+ - 1KXpv42Q/AmzAk3aIuvxWBxqLzCoNo9rdp9yGZ0958sqoJT8OnzUFn8FlOOWd1pbXYXalM4/3a3Vxw0RhWmPDA==
153
+ Date:
154
+ - Wed, 26 Apr 2017 00:52:20 GMT
155
+ Connection:
156
+ - keep-alive
157
+ Content-Length:
158
+ - '335'
159
+ body:
160
+ encoding: UTF-8
161
+ string: '{"id":"6076262142242","account_id":"10152335766987003","buying_type":"AUCTION","can_use_spend_cap":true,"configured_status":"DELETED","created_time":"2017-04-25T17:34:09-0700","effective_status":"DELETED","name":"Test","objective":"MOBILE_APP_INSTALLS","start_time":"1969-12-31T15:59:59-0800","updated_time":"2017-04-25T17:35:27-0700"}'
162
+ http_version:
163
+ recorded_at: Wed, 26 Apr 2017 00:52:20 GMT
164
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,7 @@
1
+ require 'coveralls'
2
+ Coveralls.wear!
3
+
4
+ require 'awesome_print'
5
+ require 'facebook_ads'
6
+
7
+ Dir[File.expand_path(File.join(File.dirname(__FILE__), 'support', '**', '*.rb'))].each { |f| require f }
@@ -0,0 +1,10 @@
1
+ require 'approvals/rspec'
2
+
3
+ Approvals.configure do |c|
4
+ c.approvals_path = 'spec/fixtures/approvals'
5
+ c.excluded_json_keys = {
6
+ object_id: /^id|account_id$/,
7
+ time: /^created_time|updated_time|start_time$/,
8
+ duration: /^age$/
9
+ }
10
+ end
@@ -0,0 +1,4 @@
1
+ FacebookAds.business_id = '760977220612233'
2
+ FacebookAds.access_token = ENV['FACEBOOK_ACCESS_TOKEN'] || 'fake-facebook-access-token'
3
+ # FacebookAds.logger = Logger.new(STDOUT)
4
+ # FacebookAds.logger.level = Logger::Severity::DEBUG
@@ -0,0 +1,13 @@
1
+ # Force the request headers to only accept JSON, and disable gzip.
2
+ # This makes our VCR cassettes human readable.
3
+ module RestClient
4
+ class Request
5
+ def default_headers
6
+ {
7
+ accept: 'application/json',
8
+ accept_encoding: 'identity',
9
+ user_agent: RestClient::Platform.default_user_agent
10
+ }
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,16 @@
1
+ require 'vcr'
2
+
3
+ VCR.configure do |c|
4
+ c.cassette_library_dir = 'spec/fixtures/cassettes'
5
+ c.hook_into :webmock
6
+ c.configure_rspec_metadata!
7
+ c.default_cassette_options = {
8
+ match_requests_on: [
9
+ :method,
10
+ VCR.request_matchers.uri_without_param(:access_token)
11
+ ]
12
+ }
13
+ c.filter_sensitive_data('<access_token>') do
14
+ ENV['FACEBOOK_ACCESS_TOKEN']
15
+ end
16
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: facebook_ads
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.11
4
+ version: 0.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Estreich
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-01 00:00:00.000000000 Z
11
+ date: 2017-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -47,11 +47,17 @@ extensions: []
47
47
  extra_rdoc_files:
48
48
  - README.md
49
49
  files:
50
+ - ".approvals"
51
+ - ".coveralls.yml"
50
52
  - ".gitignore"
53
+ - ".rspec"
51
54
  - ".rubocop.yml"
55
+ - ".rubocop_todo.yml"
52
56
  - ".travis.yml"
57
+ - CHANGELOG.md
53
58
  - Gemfile
54
59
  - Gemfile.lock
60
+ - LICENSE.md
55
61
  - README.md
56
62
  - Rakefile
57
63
  - bin/console
@@ -72,33 +78,45 @@ files:
72
78
  - lib/facebook_ads/ad_set.rb
73
79
  - lib/facebook_ads/ad_targeting.rb
74
80
  - lib/facebook_ads/base.rb
75
- - test/ad_account_test.rb
76
- - test/ad_campaign_test.rb
77
- - test/ad_creative_test.rb
78
- - test/ad_image_test.rb
79
- - test/ad_insight_test.rb
80
- - test/ad_product_catalog_test.rb
81
- - test/ad_product_feed_test.rb
82
- - test/ad_product_set_test.rb
83
- - test/ad_product_test.rb
84
- - test/ad_set_test.rb
85
- - test/ad_targeting_test.rb
86
- - test/ad_test.rb
87
- - test/facebook_ads_test.rb
88
- - test/test_helper.rb
89
- - test/vcr_cassettes/AdAccountTest-test_all.yml
90
- - test/vcr_cassettes/AdAccountTest-test_applications.yml
91
- - test/vcr_cassettes/AdAccountTest-test_find_by.yml
92
- - test/vcr_cassettes/AdCampaignTest-test_create.yml
93
- - test/vcr_cassettes/AdCampaignTest-test_list.yml
94
- - test/vcr_cassettes/AdImageTest-test_create.yml
95
- - test/vcr_cassettes/AdImageTest-test_list.yml
96
- - test/vcr_cassettes/AdProductCatalogTest-test_all.yml
97
- - test/vcr_cassettes/AdProductCatalogTest-test_create.yml
98
- - test/vcr_cassettes/AdProductTest-test_list.yml
99
- - test/vcr_cassettes/AdSetTest-test_create.yml
100
- - test/vcr_cassettes/AdSetTest-test_destroy.yml
101
- - test/vcr_cassettes/AdSetTest-test_update.yml
81
+ - spec/facebook_ads/ad_account_spec.rb
82
+ - spec/facebook_ads/ad_campaign_spec.rb
83
+ - spec/facebook_ads/ad_creative_spec.rb
84
+ - spec/facebook_ads/ad_image_spec.rb
85
+ - spec/facebook_ads/ad_insight_spec.rb
86
+ - spec/facebook_ads/ad_product_catalog_spec.rb
87
+ - spec/facebook_ads/ad_product_feed_spec.rb
88
+ - spec/facebook_ads/ad_product_set_spec.rb
89
+ - spec/facebook_ads/ad_product_spec.rb
90
+ - spec/facebook_ads/ad_set_spec.rb
91
+ - spec/facebook_ads/ad_spec.rb
92
+ - spec/facebook_ads/ad_targeting_spec.rb
93
+ - spec/facebook_ads/facebook_ads_spec.rb
94
+ - spec/fixtures/approvals/facebookads_adaccount/ad_campaigns/lists_campaigns.approved.json
95
+ - spec/fixtures/approvals/facebookads_adaccount/ad_creatives/lists_creatives.approved.json
96
+ - spec/fixtures/approvals/facebookads_adaccount/ad_images/lists_images.approved.json
97
+ - spec/fixtures/approvals/facebookads_adaccount/ad_sets/lists_ad_sets.approved.json
98
+ - spec/fixtures/approvals/facebookads_adaccount/ads/lists_ads.approved.json
99
+ - spec/fixtures/approvals/facebookads_adaccount/all/lists_all_accounts.approved.json
100
+ - spec/fixtures/approvals/facebookads_adaccount/create_ad_campaign/creates_a_new_ad_campaign.approved.json
101
+ - spec/fixtures/approvals/facebookads_adaccount/create_ad_images/creates_an_image.approved.json
102
+ - spec/fixtures/approvals/facebookads_adaccount/find_by/finds_a_specific_account.approved.json
103
+ - spec/fixtures/approvals/facebookads_adaccount/reach_estimate/estimates_the_reach_of_a_targeting_spec.approved.json
104
+ - spec/fixtures/cassettes/FacebookAds_AdAccount/_ad_campaigns/lists_campaigns.yml
105
+ - spec/fixtures/cassettes/FacebookAds_AdAccount/_ad_creatives/lists_creatives.yml
106
+ - spec/fixtures/cassettes/FacebookAds_AdAccount/_ad_images/lists_images.yml
107
+ - spec/fixtures/cassettes/FacebookAds_AdAccount/_ad_sets/lists_ad_sets.yml
108
+ - spec/fixtures/cassettes/FacebookAds_AdAccount/_ads/lists_ads.yml
109
+ - spec/fixtures/cassettes/FacebookAds_AdAccount/_all/lists_all_accounts.yml
110
+ - spec/fixtures/cassettes/FacebookAds_AdAccount/_create_ad_campaign/creates_a_new_ad_campaign.yml
111
+ - spec/fixtures/cassettes/FacebookAds_AdAccount/_create_ad_images/creates_an_image.yml
112
+ - spec/fixtures/cassettes/FacebookAds_AdAccount/_find_by/finds_a_specific_account.yml
113
+ - spec/fixtures/cassettes/FacebookAds_AdAccount/_reach_estimate/estimates_the_reach_of_a_targeting_spec.yml
114
+ - spec/fixtures/cassettes/FacebookAds_AdCampaign/_destroy/creates_a_new_ad_campaign.yml
115
+ - spec/spec_helper.rb
116
+ - spec/support/approvals.rb
117
+ - spec/support/facebook_ads.rb
118
+ - spec/support/rest_client.rb
119
+ - spec/support/vcr.rb
102
120
  homepage: https://github.com/cte/facebook-ruby-ads-sdk
103
121
  licenses:
104
122
  - MIT