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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c9e916084f69d4c775a025c3bb6948843c85e121
4
- data.tar.gz: f99a3b4b67c3f6209a82e26fb45903e4f85388f7
3
+ metadata.gz: 66764ff94b5fc44d7089157cd9853e53ea31b9ca
4
+ data.tar.gz: 78231722916c4547e803edfe4f54f94efc45cb19
5
5
  SHA512:
6
- metadata.gz: 7e2bad6aae8e22ac811433dbaf252447b8b3529cdaa5406d26092db792e867ab1ce4150615d068e1450d7a6e04e6066f23e7ffe225a416ea98d31d92d04d17b4
7
- data.tar.gz: d57770fdd7181beed6a70d317330c9af955f0be75ef9c4ee8cb95078922757600a3836b0c1d53ea79c53f038e2182b378e2987a55d77c7c3cae7e64c4c06871c
6
+ metadata.gz: d555f5efe1a591939df94af860ceb2391000a726416d7b864b34c409307989d91c59ced034e9fdf92e504e5ff2802b6da3012ee79175a779ee5f2ab540d4de1b
7
+ data.tar.gz: e0cfdabf5cf4f263a30c9fba1c50a3a3c8382269f4f83db8c8458b07f4e11bd33323e77550c53979168854733ef8e2848722a1e2c5820c38550aadd363555692
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fake_fb_marketing_api (0.0.1)
4
+ fake_fb_marketing_api (0.0.2)
5
5
  sinatra (~> 2.0)
6
6
  we-call (~> 0.9)
7
7
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FakeFbMarketingApi
4
- VERSION = '0.0.1'
4
+ VERSION = '0.0.2'
5
5
  end
@@ -13,7 +13,7 @@ module FakeFbMarketingApi
13
13
  FakeFacebook.owned_ad_accounts.to_json
14
14
  end
15
15
 
16
- post '/:business_id/adaccounts' do
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
- if params.key?('adaccount_id')
25
- proxy_post_to_fb(request, response)
26
- else
27
- {
28
- end_advertiser_id: params[:end_advertiser_id],
29
- media_agency_id: params[:media_agency_id],
30
- business_id: params[:business_id],
31
- account_id: ENV['FACEBOOK_AD_ACCOUNT_ID'],
32
- id: "act_%{ENV['FACEBOOK_AD_ACCOUNT_ID']}",
33
- partner_id: 'NONE'
34
- }.to_json
35
- end
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']}", 'adaccounts',
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/adaccounts' do
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, 'adaccounts',
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_%{ENV['FACEBOOK_AD_ACCOUNT_ID']}",
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.1
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-08 00:00:00.000000000 Z
11
+ date: 2019-02-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler