fake_fb_marketing_api 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/fake_fb_marketing_api/version.rb +1 -1
- data/lib/fake_fb_marketing_api/versions/v3_2.rb +14 -13
- data/spec/fake_fb_marketing_api_spec.rb +6 -4
- 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: 66764ff94b5fc44d7089157cd9853e53ea31b9ca
|
4
|
+
data.tar.gz: 78231722916c4547e803edfe4f54f94efc45cb19
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d555f5efe1a591939df94af860ceb2391000a726416d7b864b34c409307989d91c59ced034e9fdf92e504e5ff2802b6da3012ee79175a779ee5f2ab540d4de1b
|
7
|
+
data.tar.gz: e0cfdabf5cf4f263a30c9fba1c50a3a3c8382269f4f83db8c8458b07f4e11bd33323e77550c53979168854733ef8e2848722a1e2c5820c38550aadd363555692
|
data/Gemfile.lock
CHANGED
@@ -13,7 +13,7 @@ module FakeFbMarketingApi
|
|
13
13
|
FakeFacebook.owned_ad_accounts.to_json
|
14
14
|
end
|
15
15
|
|
16
|
-
post '/:business_id/
|
16
|
+
post '/:business_id/adaccount' do
|
17
17
|
content_type :json
|
18
18
|
FakeFacebook.add_owned_ad_account(
|
19
19
|
{
|
@@ -21,18 +21,19 @@ module FakeFbMarketingApi
|
|
21
21
|
'id' => ENV.fetch('FACEBOOK_AD_ACCOUNT_ID')
|
22
22
|
}
|
23
23
|
)
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
24
|
+
{
|
25
|
+
end_advertiser_id: params[:end_advertiser_id],
|
26
|
+
media_agency_id: params[:media_agency_id],
|
27
|
+
business_id: params[:business_id],
|
28
|
+
account_id: ENV['FACEBOOK_AD_ACCOUNT_ID'],
|
29
|
+
id: "act_#{ENV['FACEBOOK_AD_ACCOUNT_ID']}",
|
30
|
+
partner_id: 'NONE'
|
31
|
+
}.to_json
|
32
|
+
end
|
33
|
+
|
34
|
+
post '/:project_id/adaccounts' do
|
35
|
+
content_type :json
|
36
|
+
proxy_post_to_fb(request, response)
|
36
37
|
end
|
37
38
|
|
38
39
|
post '/:ad_account_id/assigned_users' do
|
@@ -45,7 +45,7 @@ RSpec.describe FakeFbMarketingApi::Application do
|
|
45
45
|
end_advertiser_id = Faker::Number.number(10)
|
46
46
|
media_agency_id = Faker::Number.number(10)
|
47
47
|
name = Faker::Seinfeld.character
|
48
|
-
response = graph.put_connections "#{ENV['BUSINESS_ID']}", '
|
48
|
+
response = graph.put_connections "#{ENV['BUSINESS_ID']}", 'adaccount',
|
49
49
|
name: name,
|
50
50
|
currency: 'USD', timezone_id: 6, end_advertiser_id: end_advertiser_id,
|
51
51
|
media_agency_id: media_agency_id, partner: 'NONE'
|
@@ -62,12 +62,12 @@ RSpec.describe FakeFbMarketingApi::Application do
|
|
62
62
|
end
|
63
63
|
end
|
64
64
|
|
65
|
-
describe 'POST /:business_id/
|
65
|
+
describe 'POST /:business_id/adaccount' do
|
66
66
|
context 'when creating an ad account' do
|
67
67
|
it 'works' do
|
68
68
|
end_advertiser_id = Faker::Number.number(10)
|
69
69
|
media_agency_id = Faker::Number.number(10)
|
70
|
-
response = graph.put_connections (ENV['BUSINESS_ID']).to_s, '
|
70
|
+
response = graph.put_connections (ENV['BUSINESS_ID']).to_s, 'adaccount',
|
71
71
|
name: 'Test Ad Account',
|
72
72
|
currency: 'USD', timezone_id: 6, end_advertiser_id: end_advertiser_id,
|
73
73
|
media_agency_id: media_agency_id, partner: 'NONE'
|
@@ -76,14 +76,16 @@ RSpec.describe FakeFbMarketingApi::Application do
|
|
76
76
|
{
|
77
77
|
'business_id' => ENV['BUSINESS_ID'],
|
78
78
|
'account_id' => ENV['FACEBOOK_AD_ACCOUNT_ID'],
|
79
|
-
'id' => "act_
|
79
|
+
'id' => "act_#{ENV['FACEBOOK_AD_ACCOUNT_ID']}",
|
80
80
|
'end_advertiser_id' => end_advertiser_id,
|
81
81
|
'media_agency_id' => media_agency_id,
|
82
82
|
'partner_id' => 'NONE'
|
83
83
|
}
|
84
84
|
end
|
85
85
|
end
|
86
|
+
end
|
86
87
|
|
88
|
+
describe 'POST /:project_id/adaccounts' do
|
87
89
|
context 'when adding a user to an ad account' do
|
88
90
|
it 'calls out to facebook' do
|
89
91
|
project_id = Faker::Number.number(15).to_s
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fake_fb_marketing_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Menne
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-02-
|
11
|
+
date: 2019-02-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|