fake_fb_marketing_api 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,94 @@
1
+ [
2
+ {
3
+ "code":404,
4
+ "headers":[
5
+ {
6
+ "name":"Pragma",
7
+ "value":"no-cache"
8
+ },
9
+ {
10
+ "name":"Strict-Transport-Security",
11
+ "value":"max-age=15552000; preload"
12
+ },
13
+ {
14
+ "name":"Expires",
15
+ "value":"Sat, 01 Jan 2000 00:00:00 GMT"
16
+ },
17
+ {
18
+ "name":"Cache-Control",
19
+ "value":"no-store"
20
+ },
21
+ {
22
+ "name":"Access-Control-Allow-Origin",
23
+ "value":"*"
24
+ },
25
+ {
26
+ "name":"Vary",
27
+ "value":"Accept-Encoding"
28
+ },
29
+ {
30
+ "name":"WWW-Authenticate",
31
+ "value":"OAuth \"Facebook Platform\" \"not_found\" \"(#803) Cannot query users by their username (doesnotexist)\""
32
+ },
33
+ {
34
+ "name":"X-App-Usage",
35
+ "value":"{\"call_count\":0,\"total_cputime\":0,\"total_time\":0}"
36
+ },
37
+ {
38
+ "name":"Content-Type",
39
+ "value":"text\/javascript; charset=UTF-8"
40
+ },
41
+ {
42
+ "name":"Facebook-API-Version",
43
+ "value":"v3.0"
44
+ }
45
+ ],
46
+ "body":"{\"error\":{\"message\":\"(#803) Cannot query users by their username (doesnotexist)\",\"type\":\"OAuthException\",\"code\":803,\"fbtrace_id\":\"BT5rAbba5jr\"}}"
47
+ },
48
+ {
49
+ "code":404,
50
+ "headers":[
51
+ {
52
+ "name":"Pragma",
53
+ "value":"no-cache"
54
+ },
55
+ {
56
+ "name":"Strict-Transport-Security",
57
+ "value":"max-age=15552000; preload"
58
+ },
59
+ {
60
+ "name":"Expires",
61
+ "value":"Sat, 01 Jan 2000 00:00:00 GMT"
62
+ },
63
+ {
64
+ "name":"Cache-Control",
65
+ "value":"no-store"
66
+ },
67
+ {
68
+ "name":"Access-Control-Allow-Origin",
69
+ "value":"*"
70
+ },
71
+ {
72
+ "name":"Vary",
73
+ "value":"Accept-Encoding"
74
+ },
75
+ {
76
+ "name":"WWW-Authenticate",
77
+ "value":"OAuth \"Facebook Platform\" \"not_found\" \"(#803) Cannot query users by their username (doesnotexist)\""
78
+ },
79
+ {
80
+ "name":"X-App-Usage",
81
+ "value":"{\"call_count\":0,\"total_cputime\":0,\"total_time\":0}"
82
+ },
83
+ {
84
+ "name":"Content-Type",
85
+ "value":"text\/javascript; charset=UTF-8"
86
+ },
87
+ {
88
+ "name":"Facebook-API-Version",
89
+ "value":"v3.0"
90
+ }
91
+ ],
92
+ "body":"{\"error\":{\"message\":\"(#803) Cannot query users by their username (doesnotexist)\",\"type\":\"OAuthException\",\"code\":803,\"fbtrace_id\":\"FPzxIlv5lI6\"}}"
93
+ }
94
+ ]
@@ -0,0 +1,110 @@
1
+ [
2
+ {
3
+ "code":200,
4
+ "headers":[
5
+ {
6
+ "name":"Content-Type",
7
+ "value":"text\/javascript; charset=UTF-8"
8
+ },
9
+ {
10
+ "name":"Facebook-API-Version",
11
+ "value":"v3.0"
12
+ },
13
+ {
14
+ "name":"X-App-Usage",
15
+ "value":"{\"call_count\":0,\"total_cputime\":0,\"total_time\":0}"
16
+ },
17
+ {
18
+ "name":"ETag",
19
+ "value":"\"94cbccf14637fc76526fbbc7667bfe1a79cb6630\""
20
+ },
21
+ {
22
+ "name":"Access-Control-Allow-Origin",
23
+ "value":"*"
24
+ },
25
+ {
26
+ "name":"Cache-Control",
27
+ "value":"private, no-cache, no-store, must-revalidate"
28
+ },
29
+ {
30
+ "name":"X-FB-Ads-Insights-Throttle",
31
+ "value":"{\"app_id_util_pct\": 0.00,\"acc_id_util_pct\": 0.00}"
32
+ },
33
+ {
34
+ "name":"Vary",
35
+ "value":"Accept-Encoding"
36
+ },
37
+ {
38
+ "name":"Expires",
39
+ "value":"Sat, 01 Jan 2000 00:00:00 GMT"
40
+ },
41
+ {
42
+ "name":"X-Ad-Account-Usage",
43
+ "value":"{\"acc_id_util_pct\":0}"
44
+ },
45
+ {
46
+ "name":"Strict-Transport-Security",
47
+ "value":"max-age=15552000; preload"
48
+ },
49
+ {
50
+ "name":"Pragma",
51
+ "value":"no-cache"
52
+ }
53
+ ],
54
+ "body":"{\"data\":[{\"ad_id\":\"replace_ad_id\",\"date_start\":\"2018-05-30\",\"date_stop\":\"2019-01-06\"}],\"paging\":{\"cursors\":{\"before\":\"MAZDZD\",\"after\":\"MAZDZD\"}}}"
55
+ },
56
+ {
57
+ "code":200,
58
+ "headers":[
59
+ {
60
+ "name":"Content-Type",
61
+ "value":"text\/javascript; charset=UTF-8"
62
+ },
63
+ {
64
+ "name":"Facebook-API-Version",
65
+ "value":"v3.0"
66
+ },
67
+ {
68
+ "name":"X-App-Usage",
69
+ "value":"{\"call_count\":0,\"total_cputime\":0,\"total_time\":0}"
70
+ },
71
+ {
72
+ "name":"ETag",
73
+ "value":"\"94cbccf14637fc76526fbbc7667bfe1a79cb6630\""
74
+ },
75
+ {
76
+ "name":"Access-Control-Allow-Origin",
77
+ "value":"*"
78
+ },
79
+ {
80
+ "name":"Cache-Control",
81
+ "value":"private, no-cache, no-store, must-revalidate"
82
+ },
83
+ {
84
+ "name":"X-FB-Ads-Insights-Throttle",
85
+ "value":"{\"app_id_util_pct\": 0.00,\"acc_id_util_pct\": 0.00}"
86
+ },
87
+ {
88
+ "name":"Vary",
89
+ "value":"Accept-Encoding"
90
+ },
91
+ {
92
+ "name":"Expires",
93
+ "value":"Sat, 01 Jan 2000 00:00:00 GMT"
94
+ },
95
+ {
96
+ "name":"X-Ad-Account-Usage",
97
+ "value":"{\"acc_id_util_pct\":0}"
98
+ },
99
+ {
100
+ "name":"Strict-Transport-Security",
101
+ "value":"max-age=15552000; preload"
102
+ },
103
+ {
104
+ "name":"Pragma",
105
+ "value":"no-cache"
106
+ }
107
+ ],
108
+ "body":"{\"data\":[{\"ad_id\":\"replace_ad_id\",\"date_start\":\"2018-05-30\",\"date_stop\":\"2019-01-06\"}],\"paging\":{\"cursors\":{\"before\":\"MAZDZD\",\"after\":\"MAZDZD\"}}}"
109
+ }
110
+ ]
@@ -0,0 +1,15 @@
1
+ {
2
+ "og_object":{
3
+ "title":"5 myths about organ donation",
4
+ "description":"ST. LOUIS, Mo. - Do you have the box checked on your license to be an organ donor? Perhaps it's time to think about it. April is National Donate Life Month.\r\n\nAccording to the United Network for Organ Sharing, there are 115 thousand people waiting for an organ, with a new person joining the list every 10-minutes.",
5
+ "image":[
6
+ {
7
+ "height":675,
8
+ "url":"http:\/\/localtvktvi.files.wordpress.com\/2018\/04\/promo346943397.jpg?quality=85&strip=all&w=1200",
9
+ "width":1200
10
+ }
11
+ ],
12
+ "id":"2214163825262296"
13
+ },
14
+ "id":"https:\/\/fox2now.com\/2018\/04\/02\/5-myths-about-organ-donation\/"
15
+ }
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/setup'
4
+ require 'fake_fb_marketing_api'
5
+ require 'rspec'
6
+ require 'rack/test'
7
+ require 'pry'
8
+ require 'fake_fb_marketing_api/application'
9
+ require 'faker'
10
+ require 'webmock'
11
+ require 'webmock/rspec'
12
+
13
+ ENV['RACK_ENV'] = 'test'
14
+
15
+ module RSpecMixin
16
+ include Rack::Test::Methods
17
+
18
+ def app
19
+ described_class
20
+ end
21
+ end
22
+
23
+ RSpec.configure do |config|
24
+ config.include RSpecMixin
25
+
26
+ # Enable flags like --only-failures and --next-failure
27
+ config.example_status_persistence_file_path = '.rspec_status'
28
+
29
+ # Disable RSpec exposing methods globally on `Module` and `main`
30
+ config.disable_monkey_patching!
31
+
32
+ config.expect_with :rspec do |c|
33
+ c.syntax = :expect
34
+ end
35
+ end
metadata ADDED
@@ -0,0 +1,271 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fake_fb_marketing_api
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Mike Menne
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-02-08 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.15'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.15'
27
+ - !ruby/object:Gem::Dependency
28
+ name: capybara_discoball
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: faker
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.9'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.9'
55
+ - !ruby/object:Gem::Dependency
56
+ name: faraday
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: koala
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '3.0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '3.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: pry
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: pry-byebug
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: pry-stack_explorer
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: rack-test
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '1.0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '1.0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: rake
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: '10.0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: '10.0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: rspec
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: '3.0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: '3.0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: webmock
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
181
+ - !ruby/object:Gem::Dependency
182
+ name: sinatra
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - "~>"
186
+ - !ruby/object:Gem::Version
187
+ version: '2.0'
188
+ type: :runtime
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - "~>"
193
+ - !ruby/object:Gem::Version
194
+ version: '2.0'
195
+ - !ruby/object:Gem::Dependency
196
+ name: we-call
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - "~>"
200
+ - !ruby/object:Gem::Version
201
+ version: '0.9'
202
+ type: :runtime
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - "~>"
207
+ - !ruby/object:Gem::Version
208
+ version: '0.9'
209
+ description: The key purpose of this gem is to allow developers the ability to stub
210
+ the endpoints related the the Facebook Business API. Commands such as creating
211
+ ad accounts can not be reversed and count against quota.
212
+ email:
213
+ - mike@humanagency.org
214
+ executables: []
215
+ extensions: []
216
+ extra_rdoc_files: []
217
+ files:
218
+ - ".gitignore"
219
+ - ".rspec"
220
+ - ".ruby-version"
221
+ - ".travis.yml"
222
+ - CODE_OF_CONDUCT.md
223
+ - Gemfile
224
+ - Gemfile.lock
225
+ - LICENSE.txt
226
+ - README.md
227
+ - Rakefile
228
+ - bin/console
229
+ - bin/setup
230
+ - config.ru
231
+ - fake_fb_marketing_api.gemspec
232
+ - lib/fake_fb_marketing_api.rb
233
+ - lib/fake_fb_marketing_api/.application.rb.swp
234
+ - lib/fake_fb_marketing_api/application.rb
235
+ - lib/fake_fb_marketing_api/base.rb
236
+ - lib/fake_fb_marketing_api/fake_facebook.rb
237
+ - lib/fake_fb_marketing_api/version.rb
238
+ - lib/fake_fb_marketing_api/versions/v3_0.rb
239
+ - lib/fake_fb_marketing_api/versions/v3_2.rb
240
+ - spec/.fake_fb_marketing_api_spec.rb.swo
241
+ - spec/.fake_fb_marketing_api_spec.rb.swp
242
+ - spec/fake_fb_marketing_api_spec.rb
243
+ - spec/fb_batch_error_response.json
244
+ - spec/fb_batch_response.json
245
+ - spec/fb_graph_object_response.json
246
+ - spec/spec_helper.rb
247
+ homepage: https://humanagency.org/
248
+ licenses:
249
+ - MIT
250
+ metadata: {}
251
+ post_install_message:
252
+ rdoc_options: []
253
+ require_paths:
254
+ - lib
255
+ required_ruby_version: !ruby/object:Gem::Requirement
256
+ requirements:
257
+ - - ">="
258
+ - !ruby/object:Gem::Version
259
+ version: 2.4.3
260
+ required_rubygems_version: !ruby/object:Gem::Requirement
261
+ requirements:
262
+ - - ">="
263
+ - !ruby/object:Gem::Version
264
+ version: '0'
265
+ requirements: []
266
+ rubyforge_project:
267
+ rubygems_version: 2.6.14
268
+ signing_key:
269
+ specification_version: 4
270
+ summary: Provides a stubbed interface for select Facebook Marketing API endpoints
271
+ test_files: []