soapy_bing 0.1.0 → 0.2.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.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/soapy_bing/accounts.rb +32 -0
- data/lib/soapy_bing/customer.rb +12 -0
- data/lib/soapy_bing/soap/request/get_accounts_info_request.rb +17 -0
- data/lib/soapy_bing/soap/request.rb +1 -0
- data/lib/soapy_bing/soap/response/get_accounts_info_response.rb +12 -0
- data/lib/soapy_bing/soap/response.rb +1 -0
- data/lib/soapy_bing/soap/templates/get_accounts_info.erb.xml +12 -0
- data/lib/soapy_bing/version.rb +1 -1
- data/lib/soapy_bing.rb +2 -0
- data/spec/fixtures/vcr_cassettes/SoapyBing_Accounts/_list/returns_a_list_of_SoapyBing_Account_objects.yml +100 -0
- data/spec/integration/soapy_bing/accounts_spec.rb +13 -0
- data/spec/integration/soapy_bing/ads/reports/campaign_performance_report_spec.rb +3 -3
- data/spec/integration/soapy_bing/ads_spec.rb +6 -6
- data/spec/integration/soapy_bing/oauth_credentials_spec.rb +3 -1
- data/spec/soapy_bing/account_spec.rb +10 -10
- data/spec/soapy_bing/ads/reports/campaign_performance_report_spec.rb +5 -5
- data/spec/soapy_bing/ads/reports/parsers/csv_parser_spec.rb +3 -3
- data/spec/soapy_bing/ads_spec.rb +5 -5
- data/spec/soapy_bing/helpers/class_name_spec.rb +2 -2
- data/spec/soapy_bing/helpers/ssl_version_spec.rb +5 -3
- data/spec/soapy_bing/oauth_credentials_spec.rb +13 -13
- data/spec/soapy_bing/param_guard_spec.rb +5 -5
- data/spec/soapy_bing/soap/request/base_spec.rb +10 -10
- data/spec/soapy_bing/soap/request/poll_generate_report_request_spec.rb +3 -3
- data/spec/soapy_bing/soap/response/base_spec.rb +2 -2
- data/spec/soapy_bing/soap/response/payload_spec.rb +4 -4
- data/spec/soapy_bing/soap/response/poll_generate_report_response_spec.rb +2 -2
- data/spec/soapy_bing/soap/response/report_status_spec.rb +13 -13
- data/spec/soapy_bing/soap/response/submit_generate_report_response_spec.rb +2 -2
- metadata +11 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6afe9e7e07f2ae7766ed8bf8ede8fd09bb44d959
|
4
|
+
data.tar.gz: 471bcd556c53589f2e2721507f85a4e582d29fbc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1097d26a4f5a57076061b4a550a9c0cdfdc8579bc0315d86e444c07d0d3690c743ed36e8c94b33a19f4a8f423bfd0af4452eebce034dfad243861534b642e0d1
|
7
|
+
data.tar.gz: 3f3b44dec28fc377efc7cb813efef0d69847b6e5fb6eff01a717b6244cf42da59293d17d0f63f286d5d564735de65f284d5e059df4997d24923c095e5f1c1ad8
|
data/README.md
CHANGED
@@ -8,7 +8,7 @@ Client library for [Bing Ads API](https://msdn.microsoft.com/en-us/library/bing-
|
|
8
8
|
In your Gemfile
|
9
9
|
|
10
10
|
```ruby
|
11
|
-
gem '
|
11
|
+
gem 'soapy_bing', git: 'https://github.com/ad2games/soapy_bing'
|
12
12
|
```
|
13
13
|
|
14
14
|
## Usage Examples
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module SoapyBing
|
3
|
+
class Accounts
|
4
|
+
attr_reader :oauth_credentials, :customer
|
5
|
+
|
6
|
+
def initialize(oauth: {}, customer: {})
|
7
|
+
@oauth_credentials = OauthCredentials.new(oauth)
|
8
|
+
@customer = Customer.new(customer)
|
9
|
+
end
|
10
|
+
|
11
|
+
def list
|
12
|
+
do_request(Soap::Request::GetAccountsInfoRequest).map do |account|
|
13
|
+
Account.new(
|
14
|
+
developer_token: customer.developer_token,
|
15
|
+
customer_id: customer.customer_id,
|
16
|
+
account_id: account['Id']
|
17
|
+
)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def do_request(klass, options = {})
|
24
|
+
klass.new(context: {
|
25
|
+
authentication_token: oauth_credentials.access_token,
|
26
|
+
developer_token: customer.developer_token
|
27
|
+
}.merge(options))
|
28
|
+
.perform
|
29
|
+
.payload
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module SoapyBing
|
3
|
+
class Customer
|
4
|
+
attr_reader :developer_token, :customer_id
|
5
|
+
|
6
|
+
def initialize(account_options)
|
7
|
+
param_guard = ParamGuard.new(account_options, env_namespace: 'BING_ADS')
|
8
|
+
@developer_token = param_guard.require!(:developer_token)
|
9
|
+
@customer_id = param_guard.require!(:customer_id)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module SoapyBing
|
3
|
+
module Soap
|
4
|
+
module Request
|
5
|
+
class GetAccountsInfoRequest < Base
|
6
|
+
API_BASE_URL = 'https://clientcenter.api.bingads.microsoft.com'
|
7
|
+
API_VERSION = 9
|
8
|
+
API_ENDPOINT = "#{API_BASE_URL}/Api/CustomerManagement/" \
|
9
|
+
"v#{API_VERSION}/CustomerManagementService.svc"
|
10
|
+
|
11
|
+
def perform
|
12
|
+
Response::GetAccountsInfoResponse.new(post(API_ENDPOINT))
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -5,3 +5,4 @@ require 'soapy_bing/soap/request/poll_generate_report_request'
|
|
5
5
|
require 'soapy_bing/soap/request/get_ad_groups_by_campaign_id_request'
|
6
6
|
require 'soapy_bing/soap/request/get_ads_by_ad_group_id_request'
|
7
7
|
require 'soapy_bing/soap/request/get_targets_by_campaign_ids_request'
|
8
|
+
require 'soapy_bing/soap/request/get_accounts_info_request'
|
@@ -9,3 +9,4 @@ require 'soapy_bing/soap/response/poll_generate_report_response'
|
|
9
9
|
require 'soapy_bing/soap/response/get_ad_groups_by_campaign_id_response'
|
10
10
|
require 'soapy_bing/soap/response/get_ads_by_ad_group_id_response'
|
11
11
|
require 'soapy_bing/soap/response/get_targets_by_campaign_ids_response'
|
12
|
+
require 'soapy_bing/soap/response/get_accounts_info_response'
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<s:Envelope xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
|
3
|
+
<s:Header xmlns="https://bingads.microsoft.com/Customer/v9">
|
4
|
+
<Action mustUnderstand="1">GetAccountsInfo</Action>
|
5
|
+
<AuthenticationToken><%= authentication_token %></AuthenticationToken>
|
6
|
+
<DeveloperToken><%= developer_token %></DeveloperToken>
|
7
|
+
</s:Header>
|
8
|
+
<s:Body>
|
9
|
+
<GetAccountsInfoRequest xmlns="https://bingads.microsoft.com/Customer/v9">
|
10
|
+
</GetAccountsInfoRequest>
|
11
|
+
</s:Body>
|
12
|
+
</s:Envelope>
|
data/lib/soapy_bing/version.rb
CHANGED
data/lib/soapy_bing.rb
CHANGED
@@ -6,7 +6,9 @@ require 'active_support/core_ext/string/inflections'
|
|
6
6
|
|
7
7
|
require 'soapy_bing/helpers'
|
8
8
|
require 'soapy_bing/param_guard'
|
9
|
+
require 'soapy_bing/customer'
|
9
10
|
require 'soapy_bing/account'
|
10
11
|
require 'soapy_bing/oauth_credentials'
|
11
12
|
require 'soapy_bing/soap'
|
12
13
|
require 'soapy_bing/ads'
|
14
|
+
require 'soapy_bing/accounts'
|
@@ -0,0 +1,100 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://login.live.com/oauth20_token.srf
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: client_id=bing-ads-oauth-client-id&client_secret=bing-ads-oauth-client-secret&grant_type=refresh_token&refresh_token=bing-ads-oauth-refresh-token
|
9
|
+
headers:
|
10
|
+
Accept-Encoding:
|
11
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Cache-Control:
|
22
|
+
- no-store
|
23
|
+
Pragma:
|
24
|
+
- no-cache
|
25
|
+
Content-Length:
|
26
|
+
- '1509'
|
27
|
+
Content-Type:
|
28
|
+
- application/json
|
29
|
+
Server:
|
30
|
+
- Microsoft-IIS/8.5
|
31
|
+
X-Content-Type-Options:
|
32
|
+
- nosniff
|
33
|
+
Strict-Transport-Security:
|
34
|
+
- max-age=31536000
|
35
|
+
X-Xss-Protection:
|
36
|
+
- 1; mode=block
|
37
|
+
Date:
|
38
|
+
- Tue, 16 Aug 2016 01:02:11 GMT
|
39
|
+
Connection:
|
40
|
+
- close
|
41
|
+
body:
|
42
|
+
encoding: UTF-8
|
43
|
+
string: '{"token_type":"bearer","expires_in":3600,"scope":"bingads.manage","access_token":"bing-ads-oauth-authentication-token","refresh_token":"bing-ads-oauth-refresh-token","user_id":"bing-ads-oauth-user-id"}'
|
44
|
+
http_version:
|
45
|
+
recorded_at: Tue, 16 Aug 2016 01:02:11 GMT
|
46
|
+
- request:
|
47
|
+
method: post
|
48
|
+
uri: https://clientcenter.api.bingads.microsoft.com/Api/CustomerManagement/v9/CustomerManagementService.svc
|
49
|
+
body:
|
50
|
+
encoding: UTF-8
|
51
|
+
string: |
|
52
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
53
|
+
<s:Envelope xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
|
54
|
+
<s:Header xmlns="https://bingads.microsoft.com/Customer/v9">
|
55
|
+
<Action mustUnderstand="1">GetAccountsInfo</Action>
|
56
|
+
<AuthenticationToken>bing-ads-oauth-authentication-token</AuthenticationToken>
|
57
|
+
<DeveloperToken>bing-ads-developer-token</DeveloperToken>
|
58
|
+
</s:Header>
|
59
|
+
<s:Body>
|
60
|
+
<GetAccountsInfoRequest xmlns="https://bingads.microsoft.com/Customer/v9">
|
61
|
+
</GetAccountsInfoRequest>
|
62
|
+
</s:Body>
|
63
|
+
</s:Envelope>
|
64
|
+
headers:
|
65
|
+
Content-Type:
|
66
|
+
- text/xml;charset=UTF-8
|
67
|
+
Soapaction:
|
68
|
+
- GetAccountsInfo
|
69
|
+
response:
|
70
|
+
status:
|
71
|
+
code: 200
|
72
|
+
message: OK
|
73
|
+
headers:
|
74
|
+
Cache-Control:
|
75
|
+
- private
|
76
|
+
Content-Length:
|
77
|
+
- '1078'
|
78
|
+
Content-Type:
|
79
|
+
- text/xml; charset=utf-8
|
80
|
+
Server:
|
81
|
+
- Microsoft-IIS/8.0
|
82
|
+
X-Aspnet-Version:
|
83
|
+
- 4.0.30319
|
84
|
+
X-Powered-By:
|
85
|
+
- ASP.NET
|
86
|
+
Date:
|
87
|
+
- Tue, 16 Aug 2016 01:02:12 GMT
|
88
|
+
body:
|
89
|
+
encoding: UTF-8
|
90
|
+
string: <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Header><h:TrackingId
|
91
|
+
xmlns:h="https://bingads.microsoft.com/Customer/v9">bing-ads-report-tracking-id</h:TrackingId></s:Header><s:Body><GetAccountsInfoResponse
|
92
|
+
xmlns="https://bingads.microsoft.com/Customer/v9"><AccountsInfo xmlns:a="https://bingads.microsoft.com/Customer/v9/Entities"
|
93
|
+
xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><a:AccountInfo><a:Id>1111111</a:Id><a:Name>ad2games
|
94
|
+
GmbH</a:Name><a:Number>X000F9Z7</a:Number><a:AccountLifeCycleStatus>Active</a:AccountLifeCycleStatus><a:PauseReason
|
95
|
+
i:nil="true"/></a:AccountInfo><a:AccountInfo><a:Id>2222222</a:Id><a:Name>SuperBrowserGames.com</a:Name><a:Number>X000K92F</a:Number><a:AccountLifeCycleStatus>Active</a:AccountLifeCycleStatus><a:PauseReason
|
96
|
+
i:nil="true"/></a:AccountInfo><a:AccountInfo><a:Id>33333333</a:Id><a:Name>Wildworks.com</a:Name><a:Number>B008CXY6</a:Number><a:AccountLifeCycleStatus>Active</a:AccountLifeCycleStatus><a:PauseReason
|
97
|
+
i:nil="true"/></a:AccountInfo></AccountsInfo></GetAccountsInfoResponse></s:Body></s:Envelope>
|
98
|
+
http_version:
|
99
|
+
recorded_at: Tue, 16 Aug 2016 01:02:12 GMT
|
100
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
RSpec.describe SoapyBing::Accounts do
|
3
|
+
subject(:instance) { described_class.new }
|
4
|
+
|
5
|
+
describe '#list', :vcr do
|
6
|
+
subject(:list) { instance.list }
|
7
|
+
|
8
|
+
it 'returns a list of SoapyBing::Account objects' do
|
9
|
+
expect(list.size).to eq(3)
|
10
|
+
expect(list).to all(be_an_instance_of(SoapyBing::Account))
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -17,12 +17,12 @@ RSpec.describe SoapyBing::Ads::Reports::CampaignPerformanceReport do
|
|
17
17
|
let(:fixtured_payload) { JSON.load(File.read(payload_fixture_path)) }
|
18
18
|
|
19
19
|
describe '#rows' do
|
20
|
-
subject { report.rows }
|
20
|
+
subject(:rows) { report.rows }
|
21
21
|
|
22
22
|
context 'when there is a successfull response during polling', :integration do
|
23
23
|
it 'responds with report rows',
|
24
24
|
vcr: { cassette_name: 'campaign_performance_report/with_successful_status' } do
|
25
|
-
expect(
|
25
|
+
expect(rows).to eq fixtured_payload
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
@@ -31,7 +31,7 @@ RSpec.describe SoapyBing::Ads::Reports::CampaignPerformanceReport do
|
|
31
31
|
|
32
32
|
it 'throws exception PollingTimeoutError',
|
33
33
|
vcr: { cassette_name: 'campaign_performance_report/with_pending_status' } do
|
34
|
-
expect {
|
34
|
+
expect { rows }.to raise_error(
|
35
35
|
SoapyBing::Soap::Request::PollGenerateReportRequest::PollingTimeoutError
|
36
36
|
)
|
37
37
|
end
|
@@ -9,24 +9,24 @@ RSpec.describe SoapyBing::Ads do
|
|
9
9
|
describe '#get_ad_groups_by_campaign_id', :vcr do
|
10
10
|
let(:fixture_file) { 'get_ad_groups_by_campaign_id.json' }
|
11
11
|
|
12
|
-
subject { instance.get_ad_groups_by_campaign_id(campaign_id) }
|
12
|
+
subject(:ad_groups) { instance.get_ad_groups_by_campaign_id(campaign_id) }
|
13
13
|
|
14
|
-
it { expect(
|
14
|
+
it { expect(ad_groups).to eq(fixture_payload) }
|
15
15
|
end
|
16
16
|
|
17
17
|
describe '#get_ads_by_ad_group_id', :vcr do
|
18
18
|
let(:fixture_file) { 'get_ads_by_ad_group_id.json' }
|
19
19
|
|
20
|
-
subject { instance.get_ads_by_ad_group_id(ad_group_id) }
|
20
|
+
subject(:ads) { instance.get_ads_by_ad_group_id(ad_group_id) }
|
21
21
|
|
22
|
-
it { expect(
|
22
|
+
it { expect(ads).to eq(fixture_payload) }
|
23
23
|
end
|
24
24
|
|
25
25
|
describe '#get_targets_by_campaign_ids', :vcr do
|
26
26
|
let(:fixture_file) { 'get_targets_by_campaign_ids.json' }
|
27
27
|
|
28
|
-
subject { instance.get_targets_by_campaign_ids([campaign_id]) }
|
28
|
+
subject(:targets) { instance.get_targets_by_campaign_ids([campaign_id]) }
|
29
29
|
|
30
|
-
it { expect(
|
30
|
+
it { expect(targets).to eq(fixture_payload) }
|
31
31
|
end
|
32
32
|
end
|
@@ -1,10 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
RSpec.describe SoapyBing::OauthCredentials do
|
3
|
+
subject(:oauth_credentials) { described_class.new }
|
4
|
+
|
3
5
|
describe '#access_token' do
|
4
6
|
context 'on successful respose', :integration do
|
5
7
|
it 'responds with oauth access token',
|
6
8
|
vcr: { cassette_name: 'oauth_credentials/access_token/with_successful_status' } do
|
7
|
-
expect(
|
9
|
+
expect(oauth_credentials.access_token).to eq 'bing-ads-oauth-authentication-token'
|
8
10
|
end
|
9
11
|
end
|
10
12
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
RSpec.describe SoapyBing::Account do
|
3
3
|
describe '#initialize' do
|
4
|
-
subject { described_class.new(account) }
|
4
|
+
subject(:account_obj) { described_class.new(account) }
|
5
5
|
|
6
6
|
context 'when account credentials passed explicitly' do
|
7
7
|
let(:account) do
|
@@ -14,15 +14,15 @@ RSpec.describe SoapyBing::Account do
|
|
14
14
|
end
|
15
15
|
|
16
16
|
it '#developer_token is set' do
|
17
|
-
expect(
|
17
|
+
expect(account_obj.developer_token).to eq 'foo'
|
18
18
|
end
|
19
19
|
|
20
20
|
it '#account_id is set' do
|
21
|
-
expect(
|
21
|
+
expect(account_obj.account_id).to eq 'baz'
|
22
22
|
end
|
23
23
|
|
24
24
|
it '#customer_id is set' do
|
25
|
-
expect(
|
25
|
+
expect(account_obj.customer_id).to eq 'qux'
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
@@ -35,15 +35,15 @@ RSpec.describe SoapyBing::Account do
|
|
35
35
|
end
|
36
36
|
|
37
37
|
it '#developer_token is set' do
|
38
|
-
expect(
|
38
|
+
expect(account_obj.developer_token).to eq 'foo_env'
|
39
39
|
end
|
40
40
|
|
41
41
|
it '#account_id is set' do
|
42
|
-
expect(
|
42
|
+
expect(account_obj.account_id).to eq 'baz_env'
|
43
43
|
end
|
44
44
|
|
45
45
|
it '#customer_id is set' do
|
46
|
-
expect(
|
46
|
+
expect(account_obj.customer_id).to eq 'qux_env'
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
@@ -61,19 +61,19 @@ RSpec.describe SoapyBing::Account do
|
|
61
61
|
|
62
62
|
it 'throws exception on missing :developer_token' do
|
63
63
|
account.delete(:developer_token)
|
64
|
-
expect {
|
64
|
+
expect { account_obj }.to raise_error SoapyBing::ParamGuard::ParamRequiredError,
|
65
65
|
"developer_token have to be passed explicitly or via ENV['BING_ADS_DEVELOPER_TOKEN']"
|
66
66
|
end
|
67
67
|
|
68
68
|
it 'throws exception on missing :account_id' do
|
69
69
|
account.delete(:account_id)
|
70
|
-
expect {
|
70
|
+
expect { account_obj }.to raise_error SoapyBing::ParamGuard::ParamRequiredError,
|
71
71
|
"account_id have to be passed explicitly or via ENV['BING_ADS_ACCOUNT_ID']"
|
72
72
|
end
|
73
73
|
|
74
74
|
it 'throws exception on missing :customer_id' do
|
75
75
|
account.delete(:customer_id)
|
76
|
-
expect {
|
76
|
+
expect { account_obj }.to raise_error SoapyBing::ParamGuard::ParamRequiredError,
|
77
77
|
"customer_id have to be passed explicitly or via ENV['BING_ADS_CUSTOMER_ID']"
|
78
78
|
end
|
79
79
|
end
|
@@ -3,7 +3,7 @@ require 'date'
|
|
3
3
|
|
4
4
|
RSpec.describe SoapyBing::Ads::Reports::CampaignPerformanceReport do
|
5
5
|
let(:report_options) { { oauth_credentials: nil, account: nil } }
|
6
|
-
subject { described_class.new report_options }
|
6
|
+
subject(:report) { described_class.new report_options }
|
7
7
|
|
8
8
|
describe '#initialize' do
|
9
9
|
let(:wrong_date) { 'wrong_date' }
|
@@ -13,7 +13,7 @@ RSpec.describe SoapyBing::Ads::Reports::CampaignPerformanceReport do
|
|
13
13
|
|
14
14
|
let(:start_date) { 'wrong_date' }
|
15
15
|
it 'throws exception' do
|
16
|
-
expect {
|
16
|
+
expect { report }.to raise_error(ArgumentError, 'invalid date')
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
@@ -24,18 +24,18 @@ RSpec.describe SoapyBing::Ads::Reports::CampaignPerformanceReport do
|
|
24
24
|
before { report_options.merge!(date_start: date_start, date_end: date_end) }
|
25
25
|
|
26
26
|
it 'is instance of Range' do
|
27
|
-
expect(
|
27
|
+
expect(report.date_range).to be_an_instance_of Range
|
28
28
|
end
|
29
29
|
|
30
30
|
context 'begin' do
|
31
31
|
it 'keeps initialized value' do
|
32
|
-
expect(
|
32
|
+
expect(report.date_range.begin).to eq Date.parse(date_start)
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
36
|
context 'end' do
|
37
37
|
it 'keeps initialized value' do
|
38
|
-
expect(
|
38
|
+
expect(report.date_range.end).to eq Date.parse(date_end)
|
39
39
|
end
|
40
40
|
end
|
41
41
|
end
|
@@ -4,7 +4,7 @@ require 'csv'
|
|
4
4
|
|
5
5
|
RSpec.describe SoapyBing::Ads::Reports::Parsers::CSVParser do
|
6
6
|
describe '#rows' do
|
7
|
-
subject { described_class.new(csv_data).rows }
|
7
|
+
subject(:rows) { described_class.new(csv_data).rows }
|
8
8
|
context 'on valid CSV data' do
|
9
9
|
let(:csv_fixture_path) do
|
10
10
|
File.join('spec', 'fixtures', 'reports', 'campaign_performance_report.csv')
|
@@ -17,7 +17,7 @@ RSpec.describe SoapyBing::Ads::Reports::Parsers::CSVParser do
|
|
17
17
|
let(:json_data) { JSON.load(File.read(json_fixture_path)) }
|
18
18
|
|
19
19
|
it 'responds with array of Hashes' do
|
20
|
-
expect(
|
20
|
+
expect(rows).to eq json_data
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
@@ -25,7 +25,7 @@ RSpec.describe SoapyBing::Ads::Reports::Parsers::CSVParser do
|
|
25
25
|
let(:csv_data) { '"co", "' }
|
26
26
|
|
27
27
|
it 'throws exception CSV::MalformedCSVError' do
|
28
|
-
expect {
|
28
|
+
expect { rows }.to raise_error CSV::MalformedCSVError
|
29
29
|
end
|
30
30
|
end
|
31
31
|
end
|
data/spec/soapy_bing/ads_spec.rb
CHANGED
@@ -6,28 +6,28 @@ RSpec.describe SoapyBing::Ads do
|
|
6
6
|
let(:account) do
|
7
7
|
{ developer_token: 'foo', account_id: 'baz', customer_id: 'qux' }
|
8
8
|
end
|
9
|
-
subject { described_class.new(oauth: oauth, account: account) }
|
9
|
+
subject(:ads) { described_class.new(oauth: oauth, account: account) }
|
10
10
|
|
11
11
|
describe '#oauth_credentials' do
|
12
12
|
it 'is instance of SoapyBing::OauthCredentials' do
|
13
|
-
expect(
|
13
|
+
expect(ads.oauth_credentials).to be_an_instance_of SoapyBing::OauthCredentials
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
17
|
describe '#account' do
|
18
18
|
it 'is instance of SoapyBing::Account' do
|
19
|
-
expect(
|
19
|
+
expect(ads.account).to be_an_instance_of SoapyBing::Account
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
23
|
describe '#campaign_performance_report' do
|
24
|
-
subject do
|
24
|
+
subject(:report) do
|
25
25
|
described_class
|
26
26
|
.new(oauth: oauth, account: account)
|
27
27
|
.campaign_performance_report(date_start: '2015-01-01', date_end: '2015-01-01')
|
28
28
|
end
|
29
29
|
it 'is instance of SoapyBing::Ads::Reports::CampaignPerformanceReport' do
|
30
|
-
expect(
|
30
|
+
expect(report).to be_an_instance_of SoapyBing::Ads::Reports::CampaignPerformanceReport
|
31
31
|
end
|
32
32
|
end
|
33
33
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
RSpec.describe SoapyBing::Helpers::ClassName do
|
3
3
|
describe '#class_name' do
|
4
|
-
subject do
|
4
|
+
subject(:class_name) do
|
5
5
|
stub_const(
|
6
6
|
'OUTERNS::INNERNS::MyClass',
|
7
7
|
Class.new.include(described_class)
|
@@ -9,7 +9,7 @@ RSpec.describe SoapyBing::Helpers::ClassName do
|
|
9
9
|
end
|
10
10
|
|
11
11
|
it 'resolves class name' do
|
12
|
-
expect(
|
12
|
+
expect(class_name).to eq 'MyClass'
|
13
13
|
end
|
14
14
|
end
|
15
15
|
end
|
@@ -1,7 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
RSpec.describe SoapyBing::Helpers::SSLVersion do
|
3
3
|
describe '#ssl_version' do
|
4
|
-
subject
|
4
|
+
subject(:ssl_version) do
|
5
|
+
stub_const('MyClass', Class.new.include(described_class)).new.ssl_version
|
6
|
+
end
|
5
7
|
|
6
8
|
context 'when DEFAULT_SSL_VERSION is available' do
|
7
9
|
before do
|
@@ -9,7 +11,7 @@ RSpec.describe SoapyBing::Helpers::SSLVersion do
|
|
9
11
|
end
|
10
12
|
|
11
13
|
it 'responds with DEFAULT_SSL_VERSION' do
|
12
|
-
expect(
|
14
|
+
expect(ssl_version).to be MyClass::DEFAULT_SSL_VERSION
|
13
15
|
end
|
14
16
|
end
|
15
17
|
|
@@ -17,7 +19,7 @@ RSpec.describe SoapyBing::Helpers::SSLVersion do
|
|
17
19
|
before { stub_const('OpenSSL::SSL::SSLContext::METHODS', []) }
|
18
20
|
|
19
21
|
it 'responds with OpenSSL default version' do
|
20
|
-
expect(
|
22
|
+
expect(ssl_version).to be OpenSSL::SSL::SSLContext::DEFAULT_PARAMS[:ssl_version]
|
21
23
|
end
|
22
24
|
end
|
23
25
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
RSpec.describe SoapyBing::OauthCredentials do
|
3
|
-
|
4
|
-
subject { described_class.new(credentials) }
|
3
|
+
subject(:oauth_credentials) { described_class.new(credentials) }
|
5
4
|
|
5
|
+
describe '#initialize' do
|
6
6
|
context 'when oauth credentials passed explicitly' do
|
7
7
|
let(:credentials) { { client_id: 'foo', client_secret: 'bar', refresh_token: 'baz' } }
|
8
8
|
before do
|
@@ -13,15 +13,15 @@ RSpec.describe SoapyBing::OauthCredentials do
|
|
13
13
|
end
|
14
14
|
|
15
15
|
it '#client_id is set' do
|
16
|
-
expect(
|
16
|
+
expect(oauth_credentials.client_id).to eq 'foo'
|
17
17
|
end
|
18
18
|
|
19
19
|
it '#client_secret is set' do
|
20
|
-
expect(
|
20
|
+
expect(oauth_credentials.client_secret).to eq 'bar'
|
21
21
|
end
|
22
22
|
|
23
23
|
it '#refresh_token is set' do
|
24
|
-
expect(
|
24
|
+
expect(oauth_credentials.refresh_token).to eq 'baz'
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
@@ -35,15 +35,15 @@ RSpec.describe SoapyBing::OauthCredentials do
|
|
35
35
|
end
|
36
36
|
|
37
37
|
it '#client_id is set' do
|
38
|
-
expect(
|
38
|
+
expect(oauth_credentials.client_id).to eq 'foo_env'
|
39
39
|
end
|
40
40
|
|
41
41
|
it '#client_secret is set' do
|
42
|
-
expect(
|
42
|
+
expect(oauth_credentials.client_secret).to eq 'bar_env'
|
43
43
|
end
|
44
44
|
|
45
45
|
it '#refresh_token is set' do
|
46
|
-
expect(
|
46
|
+
expect(oauth_credentials.refresh_token).to eq 'baz_env'
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
@@ -59,19 +59,19 @@ RSpec.describe SoapyBing::OauthCredentials do
|
|
59
59
|
|
60
60
|
it 'throws exception on missing :client_id' do
|
61
61
|
credentials.delete(:client_id)
|
62
|
-
expect {
|
62
|
+
expect { oauth_credentials }.to raise_error SoapyBing::ParamGuard::ParamRequiredError,
|
63
63
|
'client_id have to be passed explicitly or via ENV[\'BING_ADS_OAUTH_CLIENT_ID\']'
|
64
64
|
end
|
65
65
|
|
66
66
|
it 'throws exception on missing :client_secret' do
|
67
67
|
credentials.delete(:client_secret)
|
68
|
-
expect {
|
68
|
+
expect { oauth_credentials }.to raise_error SoapyBing::ParamGuard::ParamRequiredError,
|
69
69
|
'client_secret have to be passed explicitly or via ENV[\'BING_ADS_OAUTH_CLIENT_SECRET\']'
|
70
70
|
end
|
71
71
|
|
72
72
|
it 'throws exception on missing :refresh_token' do
|
73
73
|
credentials.delete(:refresh_token)
|
74
|
-
expect {
|
74
|
+
expect { oauth_credentials }.to raise_error SoapyBing::ParamGuard::ParamRequiredError,
|
75
75
|
'refresh_token have to be passed explicitly or via ENV[\'BING_ADS_OAUTH_REFRESH_TOKEN\']'
|
76
76
|
end
|
77
77
|
end
|
@@ -92,7 +92,7 @@ RSpec.describe SoapyBing::OauthCredentials do
|
|
92
92
|
before { expect(response).to receive(:[]).once.with('access_token').and_return('my-token') }
|
93
93
|
|
94
94
|
it 'memoizes http request response' do
|
95
|
-
2.times { expect(
|
95
|
+
2.times { expect(oauth_credentials.access_token).to eq 'my-token' }
|
96
96
|
end
|
97
97
|
end
|
98
98
|
|
@@ -100,7 +100,7 @@ RSpec.describe SoapyBing::OauthCredentials do
|
|
100
100
|
let(:status_code) { 401 }
|
101
101
|
|
102
102
|
it 'throws exception in case of bad status code' do
|
103
|
-
expect {
|
103
|
+
expect { oauth_credentials.access_token }.to raise_error(
|
104
104
|
SoapyBing::OauthCredentials::TokenRefreshError
|
105
105
|
)
|
106
106
|
end
|
@@ -2,14 +2,14 @@
|
|
2
2
|
RSpec.describe SoapyBing::ParamGuard do
|
3
3
|
describe '#require!' do
|
4
4
|
let(:param_guard) { described_class.new(options, env_namespace: 'MY') }
|
5
|
-
subject { param_guard.require!(:foo) }
|
5
|
+
subject(:require_foo) { param_guard.require!(:foo) }
|
6
6
|
|
7
7
|
context 'when option is empty' do
|
8
8
|
let(:options) { {} }
|
9
9
|
|
10
10
|
context 'and environment variable is empty too' do
|
11
11
|
it 'thows exception' do
|
12
|
-
expect {
|
12
|
+
expect { require_foo }.to raise_exception SoapyBing::ParamGuard::ParamRequiredError,
|
13
13
|
'foo have to be passed explicitly or via ENV[\'MY_FOO\']'
|
14
14
|
end
|
15
15
|
end
|
@@ -18,7 +18,7 @@ RSpec.describe SoapyBing::ParamGuard do
|
|
18
18
|
before { allow(ENV).to receive(:[]).with('MY_FOO').and_return('bar_env') }
|
19
19
|
|
20
20
|
it 'returns environment variable value' do
|
21
|
-
expect(
|
21
|
+
expect(require_foo).to eq 'bar_env'
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
@@ -30,13 +30,13 @@ RSpec.describe SoapyBing::ParamGuard do
|
|
30
30
|
before { allow(ENV).to receive(:[]).with('MY_FOO').and_return('bar_env') }
|
31
31
|
|
32
32
|
it 'returns option value' do
|
33
|
-
expect(
|
33
|
+
expect(require_foo).to eq 'bar'
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
37
|
context 'but environment variable is empty' do
|
38
38
|
it 'returns option value' do
|
39
|
-
expect(
|
39
|
+
expect(require_foo).to eq 'bar'
|
40
40
|
end
|
41
41
|
end
|
42
42
|
end
|
@@ -1,14 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
RSpec.describe SoapyBing::Soap::Request::Base do
|
3
3
|
let(:req_context) { { foo: 'Bar' } }
|
4
|
-
subject { described_class.new(context: req_context) }
|
4
|
+
subject(:request) { described_class.new(context: req_context) }
|
5
5
|
|
6
6
|
before { stub_const('MyCustomRequest', Class.new(described_class) {}) }
|
7
7
|
let(:my_custom_request) { MyCustomRequest.new(context: req_context) }
|
8
8
|
|
9
9
|
describe '#context' do
|
10
10
|
it 'keeps initialized value' do
|
11
|
-
expect(
|
11
|
+
expect(request.context).to eq req_context
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
@@ -21,35 +21,35 @@ RSpec.describe SoapyBing::Soap::Request::Base do
|
|
21
21
|
'http://example.com',
|
22
22
|
hash_including(body: body, headers: hash_including(headers))
|
23
23
|
)
|
24
|
-
|
24
|
+
request.post('http://example.com', body: body, headers: headers)
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
28
|
describe '#default_body' do
|
29
|
-
subject { my_custom_request.default_body }
|
29
|
+
subject(:default_body) { my_custom_request.default_body }
|
30
30
|
it 'renders request body template' do
|
31
31
|
renderer = instance_double(SoapyBing::Soap::TemplateRenderer)
|
32
32
|
expect(SoapyBing::Soap::TemplateRenderer).to receive(:new)
|
33
33
|
.with(hash_including(req_context)).and_return(renderer)
|
34
34
|
expect(renderer).to receive(:render).with('my_custom')
|
35
|
-
|
35
|
+
default_body
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
39
|
describe '#default_headers' do
|
40
|
-
subject { my_custom_request.default_headers }
|
40
|
+
subject(:default_headers) { my_custom_request.default_headers }
|
41
41
|
it 'contains soap action' do
|
42
|
-
expect(
|
42
|
+
expect(default_headers).to include('SOAPAction' => 'MyCustom')
|
43
43
|
end
|
44
44
|
it 'contains default headers' do
|
45
|
-
expect(
|
45
|
+
expect(default_headers).to include(described_class::DEFAULT_HTTP_HEADERS)
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
49
49
|
describe '#action_name' do
|
50
|
-
subject { my_custom_request.action_name }
|
50
|
+
subject(:action_name) { my_custom_request.action_name }
|
51
51
|
it 'resolves request\'s class soap action' do
|
52
|
-
expect(
|
52
|
+
expect(action_name).to eq 'MyCustom'
|
53
53
|
end
|
54
54
|
end
|
55
55
|
end
|
@@ -35,7 +35,7 @@ RSpec.describe SoapyBing::Soap::Request::PollGenerateReportRequest do
|
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
|
-
subject do
|
38
|
+
subject(:perform) do
|
39
39
|
described_class
|
40
40
|
.new(
|
41
41
|
context: {
|
@@ -48,13 +48,13 @@ RSpec.describe SoapyBing::Soap::Request::PollGenerateReportRequest do
|
|
48
48
|
|
49
49
|
it 'polls until successful response' do
|
50
50
|
expect(HTTParty).to receive(:post).exactly(3).times
|
51
|
-
expect(
|
51
|
+
expect(perform.payload).to eq 'http://example.com'
|
52
52
|
end
|
53
53
|
|
54
54
|
it 'throws PollingTimeoutError when exceeded polling tries' do
|
55
55
|
stub_const('SoapyBing::Soap::Request::PollGenerateReportRequest::POLLING_TRIES', 1)
|
56
56
|
expect(HTTParty).to receive(:post).once
|
57
|
-
expect {
|
57
|
+
expect { perform }.to raise_error described_class::PollingTimeoutError
|
58
58
|
end
|
59
59
|
end
|
60
60
|
end
|
@@ -5,9 +5,9 @@ RSpec.describe SoapyBing::Soap::Response::Base do
|
|
5
5
|
let(:my_custom_response) { MyCustomResponse.new(response_body) }
|
6
6
|
|
7
7
|
describe '#body' do
|
8
|
-
subject { my_custom_response.body }
|
8
|
+
subject(:body) { my_custom_response.body }
|
9
9
|
it 'keeps initialized value' do
|
10
|
-
expect(
|
10
|
+
expect(body).to eq response_body
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
@@ -9,18 +9,18 @@ RSpec.describe SoapyBing::Soap::Response::Payload do
|
|
9
9
|
)
|
10
10
|
end
|
11
11
|
|
12
|
-
subject { MyCustomResponse.new }
|
12
|
+
subject(:response) { MyCustomResponse.new }
|
13
13
|
|
14
14
|
describe '#payload' do
|
15
15
|
it 'memoize #extract_payload value' do
|
16
|
-
expect(
|
17
|
-
2.times {
|
16
|
+
expect(response).to receive(:extract_payload).once.and_return(true)
|
17
|
+
2.times { response.payload }
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
21
|
describe '#extract_payload' do
|
22
22
|
it 'throws NotImplementedError' do
|
23
|
-
expect {
|
23
|
+
expect { response.extract_payload }.to raise_error NotImplementedError
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
@@ -14,13 +14,13 @@ RSpec.describe SoapyBing::Soap::Response::PollGenerateReportResponse do
|
|
14
14
|
}
|
15
15
|
}
|
16
16
|
end
|
17
|
-
|
17
|
+
subject(:response) { described_class.new(response_hash) }
|
18
18
|
|
19
19
|
it 'includes ReportStatus' do
|
20
20
|
expect(described_class.ancestors).to include SoapyBing::Soap::Response::ReportStatus
|
21
21
|
end
|
22
22
|
|
23
23
|
it '#extract_payload returns download url' do
|
24
|
-
expect(
|
24
|
+
expect(response.extract_payload).to eq url
|
25
25
|
end
|
26
26
|
end
|
@@ -21,7 +21,7 @@ RSpec.describe SoapyBing::Soap::Response::ReportStatus do
|
|
21
21
|
}
|
22
22
|
}
|
23
23
|
end
|
24
|
-
|
24
|
+
subject(:response) { MyCustomResponse.new(response_hash) }
|
25
25
|
|
26
26
|
describe 'status' do
|
27
27
|
before do
|
@@ -33,19 +33,19 @@ RSpec.describe SoapyBing::Soap::Response::ReportStatus do
|
|
33
33
|
let(:status) { 'Error' }
|
34
34
|
|
35
35
|
it '#status is Error' do
|
36
|
-
expect(
|
36
|
+
expect(response.status).to eq status
|
37
37
|
end
|
38
38
|
|
39
39
|
it '#error? is false' do
|
40
|
-
expect(
|
40
|
+
expect(response).to be_error
|
41
41
|
end
|
42
42
|
|
43
43
|
it '#success? is false' do
|
44
|
-
expect(
|
44
|
+
expect(response).not_to be_success
|
45
45
|
end
|
46
46
|
|
47
47
|
it '#pending? is false' do
|
48
|
-
expect(
|
48
|
+
expect(response).not_to be_pending
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
@@ -53,19 +53,19 @@ RSpec.describe SoapyBing::Soap::Response::ReportStatus do
|
|
53
53
|
let(:status) { 'Success' }
|
54
54
|
|
55
55
|
it '#status is Success' do
|
56
|
-
expect(
|
56
|
+
expect(response.status).to eq status
|
57
57
|
end
|
58
58
|
|
59
59
|
it '#error? is false' do
|
60
|
-
expect(
|
60
|
+
expect(response).not_to be_error
|
61
61
|
end
|
62
62
|
|
63
63
|
it '#success? is true' do
|
64
|
-
expect(
|
64
|
+
expect(response).to be_success
|
65
65
|
end
|
66
66
|
|
67
67
|
it '#pending? is false' do
|
68
|
-
expect(
|
68
|
+
expect(response).not_to be_pending
|
69
69
|
end
|
70
70
|
end
|
71
71
|
|
@@ -73,19 +73,19 @@ RSpec.describe SoapyBing::Soap::Response::ReportStatus do
|
|
73
73
|
let(:status) { 'Pending' }
|
74
74
|
|
75
75
|
it '#status is Pending' do
|
76
|
-
expect(
|
76
|
+
expect(response.status).to eq status
|
77
77
|
end
|
78
78
|
|
79
79
|
it '#error? is false' do
|
80
|
-
expect(
|
80
|
+
expect(response).not_to be_error
|
81
81
|
end
|
82
82
|
|
83
83
|
it '#success? is false' do
|
84
|
-
expect(
|
84
|
+
expect(response).not_to be_success
|
85
85
|
end
|
86
86
|
|
87
87
|
it '#pending? is true' do
|
88
|
-
expect(
|
88
|
+
expect(response).to be_pending
|
89
89
|
end
|
90
90
|
end
|
91
91
|
end
|
@@ -12,9 +12,9 @@ RSpec.describe SoapyBing::Soap::Response::SubmitGenerateReportResponse do
|
|
12
12
|
}
|
13
13
|
}
|
14
14
|
end
|
15
|
-
|
15
|
+
subject(:response) { described_class.new(response_hash) }
|
16
16
|
|
17
17
|
it '#extract_payload returns request id' do
|
18
|
-
expect(
|
18
|
+
expect(response.extract_payload).to eq request_id
|
19
19
|
end
|
20
20
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: soapy_bing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ad2games GmbH
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: erubis
|
@@ -195,12 +195,14 @@ files:
|
|
195
195
|
- circle.yml
|
196
196
|
- lib/soapy_bing.rb
|
197
197
|
- lib/soapy_bing/account.rb
|
198
|
+
- lib/soapy_bing/accounts.rb
|
198
199
|
- lib/soapy_bing/ads.rb
|
199
200
|
- lib/soapy_bing/ads/reports.rb
|
200
201
|
- lib/soapy_bing/ads/reports/base.rb
|
201
202
|
- lib/soapy_bing/ads/reports/campaign_performance_report.rb
|
202
203
|
- lib/soapy_bing/ads/reports/parsers.rb
|
203
204
|
- lib/soapy_bing/ads/reports/parsers/csv_parser.rb
|
205
|
+
- lib/soapy_bing/customer.rb
|
204
206
|
- lib/soapy_bing/helpers.rb
|
205
207
|
- lib/soapy_bing/helpers/class_name.rb
|
206
208
|
- lib/soapy_bing/helpers/ssl_version.rb
|
@@ -209,6 +211,7 @@ files:
|
|
209
211
|
- lib/soapy_bing/soap.rb
|
210
212
|
- lib/soapy_bing/soap/request.rb
|
211
213
|
- lib/soapy_bing/soap/request/base.rb
|
214
|
+
- lib/soapy_bing/soap/request/get_accounts_info_request.rb
|
212
215
|
- lib/soapy_bing/soap/request/get_ad_groups_by_campaign_id_request.rb
|
213
216
|
- lib/soapy_bing/soap/request/get_ads_by_ad_group_id_request.rb
|
214
217
|
- lib/soapy_bing/soap/request/get_targets_by_campaign_ids_request.rb
|
@@ -216,6 +219,7 @@ files:
|
|
216
219
|
- lib/soapy_bing/soap/request/submit_generate_report_request.rb
|
217
220
|
- lib/soapy_bing/soap/response.rb
|
218
221
|
- lib/soapy_bing/soap/response/base.rb
|
222
|
+
- lib/soapy_bing/soap/response/get_accounts_info_response.rb
|
219
223
|
- lib/soapy_bing/soap/response/get_ad_groups_by_campaign_id_response.rb
|
220
224
|
- lib/soapy_bing/soap/response/get_ads_by_ad_group_id_response.rb
|
221
225
|
- lib/soapy_bing/soap/response/get_targets_by_campaign_ids_response.rb
|
@@ -224,6 +228,7 @@ files:
|
|
224
228
|
- lib/soapy_bing/soap/response/report_status.rb
|
225
229
|
- lib/soapy_bing/soap/response/submit_generate_report_response.rb
|
226
230
|
- lib/soapy_bing/soap/template_renderer.rb
|
231
|
+
- lib/soapy_bing/soap/templates/get_accounts_info.erb.xml
|
227
232
|
- lib/soapy_bing/soap/templates/get_ad_groups_by_campaign_id.erb.xml
|
228
233
|
- lib/soapy_bing/soap/templates/get_ads_by_ad_group_id.erb.xml
|
229
234
|
- lib/soapy_bing/soap/templates/get_targets_by_campaign_ids.erb.xml
|
@@ -240,12 +245,14 @@ files:
|
|
240
245
|
- spec/fixtures/reports/campaign_performance_report.csv
|
241
246
|
- spec/fixtures/reports/campaign_performance_report.json
|
242
247
|
- spec/fixtures/soap_templates/simple.erb.xml
|
248
|
+
- spec/fixtures/vcr_cassettes/SoapyBing_Accounts/_list/returns_a_list_of_SoapyBing_Account_objects.yml
|
243
249
|
- spec/fixtures/vcr_cassettes/SoapyBing_Ads/_get_ad_groups_by_campaign_id/1_1_1.yml
|
244
250
|
- spec/fixtures/vcr_cassettes/SoapyBing_Ads/_get_ads_by_ad_group_id/1_2_1.yml
|
245
251
|
- spec/fixtures/vcr_cassettes/SoapyBing_Ads/_get_targets_by_campaign_ids/1_3_1.yml
|
246
252
|
- spec/fixtures/vcr_cassettes/campaign_performance_report/with_pending_status.yml
|
247
253
|
- spec/fixtures/vcr_cassettes/campaign_performance_report/with_successful_status.yml
|
248
254
|
- spec/fixtures/vcr_cassettes/oauth_credentials/access_token/with_successful_status.yml
|
255
|
+
- spec/integration/soapy_bing/accounts_spec.rb
|
249
256
|
- spec/integration/soapy_bing/ads/reports/campaign_performance_report_spec.rb
|
250
257
|
- spec/integration/soapy_bing/ads_spec.rb
|
251
258
|
- spec/integration/soapy_bing/oauth_credentials_spec.rb
|
@@ -300,12 +307,14 @@ test_files:
|
|
300
307
|
- spec/fixtures/reports/campaign_performance_report.csv
|
301
308
|
- spec/fixtures/reports/campaign_performance_report.json
|
302
309
|
- spec/fixtures/soap_templates/simple.erb.xml
|
310
|
+
- spec/fixtures/vcr_cassettes/SoapyBing_Accounts/_list/returns_a_list_of_SoapyBing_Account_objects.yml
|
303
311
|
- spec/fixtures/vcr_cassettes/SoapyBing_Ads/_get_ad_groups_by_campaign_id/1_1_1.yml
|
304
312
|
- spec/fixtures/vcr_cassettes/SoapyBing_Ads/_get_ads_by_ad_group_id/1_2_1.yml
|
305
313
|
- spec/fixtures/vcr_cassettes/SoapyBing_Ads/_get_targets_by_campaign_ids/1_3_1.yml
|
306
314
|
- spec/fixtures/vcr_cassettes/campaign_performance_report/with_pending_status.yml
|
307
315
|
- spec/fixtures/vcr_cassettes/campaign_performance_report/with_successful_status.yml
|
308
316
|
- spec/fixtures/vcr_cassettes/oauth_credentials/access_token/with_successful_status.yml
|
317
|
+
- spec/integration/soapy_bing/accounts_spec.rb
|
309
318
|
- spec/integration/soapy_bing/ads/reports/campaign_performance_report_spec.rb
|
310
319
|
- spec/integration/soapy_bing/ads_spec.rb
|
311
320
|
- spec/integration/soapy_bing/oauth_credentials_spec.rb
|