soapy_cake 1.8.1 → 1.9.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/api_versions.yml +1 -1
- data/lib/soapy_cake/admin.rb +9 -5
- data/lib/soapy_cake/admin_addedit.rb +25 -1
- data/lib/soapy_cake/helper.rb +8 -0
- data/lib/soapy_cake/response.rb +14 -0
- data/lib/soapy_cake/version.rb +1 -1
- data/spec/fixtures/vcr_cassettes/SoapyCake_Admin/creates_an_affiliate_and_returns_the_ID.yml +1 -1
- data/spec/fixtures/vcr_cassettes/SoapyCake_Admin/returns_media_types.yml +48 -0
- data/spec/fixtures/vcr_cassettes/SoapyCake_AdminAddedit/campaigns/adds_a_campaign.yml +56 -0
- data/spec/fixtures/vcr_cassettes/SoapyCake_AdminAddedit/campaigns/edits_a_campaign.yml +56 -0
- data/spec/fixtures/vcr_cassettes/SoapyCake_AdminAddedit/offers/creates_an_offer.yml +1 -1
- data/spec/fixtures/vcr_cassettes/SoapyCake_AdminAddedit/offers/updates_an_offer.yml +1 -1
- data/spec/integration/soapy_cake/admin_addedit_spec.rb +28 -0
- data/spec/integration/soapy_cake/admin_spec.rb +11 -0
- data/spec/lib/soapy_cake/admin_spec.rb +5 -5
- data/spec/support/admin_method_example.rb +2 -2
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e316df7a7a9c2e50db3dec1cda60ec4095d01184
|
4
|
+
data.tar.gz: 6720a6ab9d6aa939ae5360842d11102af473ff9e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97a4313edc0705a004613b72e89830310621f3eb6a174debe8d35b688126fff9e4ccdda0efdb599e7d5d6e9094c1cdd5a010cfd303e1556d484b386bd6c59b0a
|
7
|
+
data.tar.gz: 951252dab7d028540ed035cb298c0daa7241a88d219b26b24b3eab94dc8a92759fb1dae0205354d8a9d9c46943a0b86ea8e80ee630bfcfc6261709efe44f4cc1
|
data/api_versions.yml
CHANGED
data/lib/soapy_cake/admin.rb
CHANGED
@@ -78,11 +78,11 @@ module SoapyCake
|
|
78
78
|
run Request.new(:admin, :reports, :caps, opts)
|
79
79
|
end
|
80
80
|
|
81
|
-
def currencies
|
81
|
+
def currencies
|
82
82
|
run Request.new(:admin, :get, :currencies, {})
|
83
83
|
end
|
84
84
|
|
85
|
-
def tiers
|
85
|
+
def tiers
|
86
86
|
run Request.new(:admin, :get, :affiliate_tiers, {})
|
87
87
|
end
|
88
88
|
|
@@ -102,11 +102,15 @@ module SoapyCake
|
|
102
102
|
run Request.new(:admin, :signup, :affiliate, opts)
|
103
103
|
end
|
104
104
|
|
105
|
-
def
|
105
|
+
def media_types
|
106
|
+
run(Request.new(:admin, :signup, :get_media_types, {}))[:MediaType]
|
107
|
+
end
|
108
|
+
|
109
|
+
def verticals
|
106
110
|
run Request.new(:admin, :get, :verticals, {})
|
107
111
|
end
|
108
112
|
|
109
|
-
def countries
|
113
|
+
def countries
|
110
114
|
run Request.new(:admin, :get, :countries, {})
|
111
115
|
end
|
112
116
|
|
@@ -114,7 +118,7 @@ module SoapyCake
|
|
114
118
|
run Request.new(:admin, :get, :payment_types, {})
|
115
119
|
end
|
116
120
|
|
117
|
-
def blacklist_reasons
|
121
|
+
def blacklist_reasons
|
118
122
|
run Request.new(:admin, :get, :blacklist_reasons, {})
|
119
123
|
end
|
120
124
|
end
|
@@ -151,6 +151,17 @@ module SoapyCake
|
|
151
151
|
run Request.new(:admin, :addedit, :affiliate, opts)
|
152
152
|
end
|
153
153
|
|
154
|
+
def add_campaign(opts)
|
155
|
+
addedit_campaign(opts.merge(campaign_id: 0))
|
156
|
+
end
|
157
|
+
|
158
|
+
def edit_campaign(opts)
|
159
|
+
require_params(opts, %i(campaign_id))
|
160
|
+
validate_id(opts, :campaign_id)
|
161
|
+
|
162
|
+
addedit_campaign(opts)
|
163
|
+
end
|
164
|
+
|
154
165
|
private
|
155
166
|
|
156
167
|
def apply_tag_opts!(opts)
|
@@ -169,7 +180,7 @@ module SoapyCake
|
|
169
180
|
OFFER_DEFAULT_OPTIONS.merge(
|
170
181
|
conversion_cap_behavior: const_lookup(:conversion_behavior_id, :system),
|
171
182
|
conversion_behavior_on_redirect: const_lookup(:conversion_behavior_id, :system),
|
172
|
-
expiration_date:
|
183
|
+
expiration_date: future_expiration_date
|
173
184
|
)
|
174
185
|
end
|
175
186
|
|
@@ -193,5 +204,18 @@ module SoapyCake
|
|
193
204
|
|
194
205
|
run Request.new(:admin, :addedit, :offer_contract, opts)
|
195
206
|
end
|
207
|
+
|
208
|
+
def addedit_campaign(opts)
|
209
|
+
require_params(opts, %i(affiliate_id offer_id media_type_id account_status_id payout))
|
210
|
+
|
211
|
+
translate_values!(opts, %i(account_status_id))
|
212
|
+
|
213
|
+
opts.reverse_merge!(
|
214
|
+
display_link_type_id: 1,
|
215
|
+
expiration_date: future_expiration_date
|
216
|
+
)
|
217
|
+
|
218
|
+
run Request.new(:admin, :addedit, :campaign, opts)
|
219
|
+
end
|
196
220
|
end
|
197
221
|
end
|
data/lib/soapy_cake/helper.rb
CHANGED
@@ -41,5 +41,13 @@ module SoapyCake
|
|
41
41
|
fail ArgumentError, "#{key} is not a valid value for #{type}"
|
42
42
|
end
|
43
43
|
end
|
44
|
+
|
45
|
+
# Some API calls require expiration dates.
|
46
|
+
# The default is to not expire campaigns/offers/etc., so we set this to far in the future.
|
47
|
+
# It cannot be *that* far in the future though because it causes a datetime overflow
|
48
|
+
# in the steam powered rusty black box they call a database server.
|
49
|
+
def future_expiration_date
|
50
|
+
Date.today + (365 * 30)
|
51
|
+
end
|
44
52
|
end
|
45
53
|
end
|
data/lib/soapy_cake/response.rb
CHANGED
@@ -38,9 +38,23 @@ module SoapyCake
|
|
38
38
|
def check_errors!
|
39
39
|
fault = sax.for_tag(:fault).first
|
40
40
|
fail RequestFailed, fault[:reason][:text] if fault
|
41
|
+
|
42
|
+
return if error_check_special_case?
|
43
|
+
|
41
44
|
fail RequestFailed, error_message unless sax.for_tag(:success).first == 'true'
|
42
45
|
end
|
43
46
|
|
47
|
+
def error_check_special_case?
|
48
|
+
# Don't ask...
|
49
|
+
# As you might imagine, CAKE simply does not return the success element
|
50
|
+
# for this specific request. Also, this is the only request with a tag depth
|
51
|
+
# of 4, not 3 or 5 like ALL OTHER requests.
|
52
|
+
# BTW: There is a 10$ reward if anyone can find a worse designed API.
|
53
|
+
return true if sax.for_tag(:MediaType).count > 0
|
54
|
+
|
55
|
+
false
|
56
|
+
end
|
57
|
+
|
44
58
|
def error_message
|
45
59
|
sax.for_tag(:message).first || sax.for_tag(:Text).first || 'Unknown error'
|
46
60
|
end
|
data/lib/soapy_cake/version.rb
CHANGED
data/spec/fixtures/vcr_cassettes/SoapyCake_Admin/creates_an_affiliate_and_returns_the_ID.yml
CHANGED
@@ -26,7 +26,7 @@ http_interactions:
|
|
26
26
|
<cake:contact_first_name>Foxy</cake:contact_first_name>
|
27
27
|
<cake:contact_last_name>Fox</cake:contact_last_name>
|
28
28
|
<cake:contact_email_address>foxy@forrest.com</cake:contact_email_address>
|
29
|
-
<cake:date_added>2015-06-
|
29
|
+
<cake:date_added>2015-06-15T01:00:00</cake:date_added>
|
30
30
|
</cake:Affiliate>
|
31
31
|
</env:Body>
|
32
32
|
</env:Envelope>
|
@@ -0,0 +1,48 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://cake-partner-domain.com/api/1/signup.asmx
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: |
|
9
|
+
<?xml version="1.0"?>
|
10
|
+
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:cake="http://cakemarketing.com/api/1/">
|
11
|
+
<env:Header/>
|
12
|
+
<env:Body>
|
13
|
+
<cake:GetMediaTypes>
|
14
|
+
<cake:api_key>cake-api-key</cake:api_key>
|
15
|
+
</cake:GetMediaTypes>
|
16
|
+
</env:Body>
|
17
|
+
</env:Envelope>
|
18
|
+
headers:
|
19
|
+
Content-Type:
|
20
|
+
- application/soap+xml;charset=UTF-8
|
21
|
+
response:
|
22
|
+
status:
|
23
|
+
code: 200
|
24
|
+
message: OK
|
25
|
+
headers:
|
26
|
+
Cache-Control:
|
27
|
+
- private, max-age=0
|
28
|
+
Content-Type:
|
29
|
+
- application/soap+xml; charset=utf-8
|
30
|
+
Server:
|
31
|
+
- Microsoft-IIS/8.0
|
32
|
+
X-Aspnet-Version:
|
33
|
+
- 4.0.30319
|
34
|
+
X-Powered-By:
|
35
|
+
- ASP.NET
|
36
|
+
Date:
|
37
|
+
- Mon, 15 Jun 2015 13:08:16 GMT
|
38
|
+
Content-Length:
|
39
|
+
- '1736'
|
40
|
+
body:
|
41
|
+
encoding: UTF-8
|
42
|
+
string: <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
|
43
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><GetMediaTypesResponse
|
44
|
+
xmlns="http://cakemarketing.com/api/1/"><GetMediaTypesResult><MediaType><media_type_id>15</media_type_id><type_name>Adware</type_name></MediaType><MediaType><media_type_id>7</media_type_id><type_name>Banner</type_name></MediaType><MediaType><media_type_id>17</media_type_id><type_name>Content</type_name></MediaType><MediaType><media_type_id>6</media_type_id><type_name>Co-Reg</type_name></MediaType><MediaType><media_type_id>3</media_type_id><type_name>Email</type_name></MediaType><MediaType><media_type_id>12</media_type_id><type_name>Incentivized</type_name></MediaType><MediaType><media_type_id>2</media_type_id><type_name>Network</type_name></MediaType><MediaType><media_type_id>13</media_type_id><type_name>Other</type_name></MediaType><MediaType><media_type_id>8</media_type_id><type_name>PopUnder</type_name></MediaType><MediaType><media_type_id>4</media_type_id><type_name>PPC</type_name></MediaType><MediaType><media_type_id>9</media_type_id><type_name>Radio</type_name></MediaType><MediaType><media_type_id>5</media_type_id><type_name>SEO</type_name></MediaType><MediaType><media_type_id>16</media_type_id><type_name>Social
|
45
|
+
Media</type_name></MediaType><MediaType><media_type_id>10</media_type_id><type_name>TV</type_name></MediaType><MediaType><media_type_id>11</media_type_id><type_name>Upsell</type_name></MediaType><MediaType><media_type_id>1</media_type_id><type_name>YouTube_Twitch</type_name></MediaType></GetMediaTypesResult></GetMediaTypesResponse></soap:Body></soap:Envelope>
|
46
|
+
http_version:
|
47
|
+
recorded_at: Mon, 15 Jun 2015 13:08:40 GMT
|
48
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,56 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://cake-partner-domain.com/api/3/addedit.asmx
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: |
|
9
|
+
<?xml version="1.0"?>
|
10
|
+
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:cake="http://cakemarketing.com/api/3/">
|
11
|
+
<env:Header/>
|
12
|
+
<env:Body>
|
13
|
+
<cake:Campaign>
|
14
|
+
<cake:api_key>cake-api-key</cake:api_key>
|
15
|
+
<cake:affiliate_id>1</cake:affiliate_id>
|
16
|
+
<cake:offer_id>8910</cake:offer_id>
|
17
|
+
<cake:media_type_id>1</cake:media_type_id>
|
18
|
+
<cake:account_status_id>1</cake:account_status_id>
|
19
|
+
<cake:payout>1.23</cake:payout>
|
20
|
+
<cake:campaign_id>0</cake:campaign_id>
|
21
|
+
<cake:display_link_type_id>1</cake:display_link_type_id>
|
22
|
+
<cake:expiration_date>2045-02-09T01:00:00</cake:expiration_date>
|
23
|
+
</cake:Campaign>
|
24
|
+
</env:Body>
|
25
|
+
</env:Envelope>
|
26
|
+
headers:
|
27
|
+
Content-Type:
|
28
|
+
- application/soap+xml;charset=UTF-8
|
29
|
+
response:
|
30
|
+
status:
|
31
|
+
code: 200
|
32
|
+
message: OK
|
33
|
+
headers:
|
34
|
+
Cache-Control:
|
35
|
+
- private, max-age=0
|
36
|
+
Content-Type:
|
37
|
+
- application/soap+xml; charset=utf-8
|
38
|
+
Server:
|
39
|
+
- Microsoft-IIS/8.0
|
40
|
+
X-Aspnet-Version:
|
41
|
+
- 4.0.30319
|
42
|
+
X-Powered-By:
|
43
|
+
- ASP.NET
|
44
|
+
Date:
|
45
|
+
- Mon, 15 Jun 2015 12:26:41 GMT
|
46
|
+
Content-Length:
|
47
|
+
- '628'
|
48
|
+
body:
|
49
|
+
encoding: UTF-8
|
50
|
+
string: <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
|
51
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><CampaignResponse
|
52
|
+
xmlns="http://cakemarketing.com/api/3/"><CampaignResult><success>true</success><message>Campaign
|
53
|
+
Created</message><success_info><campaign_id>18243</campaign_id><affiliate_id>1</affiliate_id><offer_id>8910</offer_id><offer_contract_id>1455</offer_contract_id><media_type_id>1</media_type_id><original>true</original></success_info></CampaignResult></CampaignResponse></soap:Body></soap:Envelope>
|
54
|
+
http_version:
|
55
|
+
recorded_at: Tue, 17 Feb 2015 12:00:00 GMT
|
56
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,56 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://cake-partner-domain.com/api/3/addedit.asmx
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: |
|
9
|
+
<?xml version="1.0"?>
|
10
|
+
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:cake="http://cakemarketing.com/api/3/">
|
11
|
+
<env:Header/>
|
12
|
+
<env:Body>
|
13
|
+
<cake:Campaign>
|
14
|
+
<cake:api_key>cake-api-key</cake:api_key>
|
15
|
+
<cake:campaign_id>123</cake:campaign_id>
|
16
|
+
<cake:affiliate_id>1</cake:affiliate_id>
|
17
|
+
<cake:offer_id>8910</cake:offer_id>
|
18
|
+
<cake:media_type_id>1</cake:media_type_id>
|
19
|
+
<cake:account_status_id>1</cake:account_status_id>
|
20
|
+
<cake:payout>1.23</cake:payout>
|
21
|
+
<cake:display_link_type_id>1</cake:display_link_type_id>
|
22
|
+
<cake:expiration_date>2045-02-09T01:00:00</cake:expiration_date>
|
23
|
+
</cake:Campaign>
|
24
|
+
</env:Body>
|
25
|
+
</env:Envelope>
|
26
|
+
headers:
|
27
|
+
Content-Type:
|
28
|
+
- application/soap+xml;charset=UTF-8
|
29
|
+
response:
|
30
|
+
status:
|
31
|
+
code: 200
|
32
|
+
message: OK
|
33
|
+
headers:
|
34
|
+
Cache-Control:
|
35
|
+
- private, max-age=0
|
36
|
+
Content-Type:
|
37
|
+
- application/soap+xml; charset=utf-8
|
38
|
+
Server:
|
39
|
+
- Microsoft-IIS/8.0
|
40
|
+
X-Aspnet-Version:
|
41
|
+
- 4.0.30319
|
42
|
+
X-Powered-By:
|
43
|
+
- ASP.NET
|
44
|
+
Date:
|
45
|
+
- Mon, 15 Jun 2015 12:27:13 GMT
|
46
|
+
Content-Length:
|
47
|
+
- '626'
|
48
|
+
body:
|
49
|
+
encoding: UTF-8
|
50
|
+
string: <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
|
51
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><CampaignResponse
|
52
|
+
xmlns="http://cakemarketing.com/api/3/"><CampaignResult><success>true</success><message>Campaign
|
53
|
+
Updated</message><success_info><campaign_id>123</campaign_id><affiliate_id>-1</affiliate_id><offer_id>5078</offer_id><offer_contract_id>123</offer_contract_id><media_type_id>1</media_type_id><original>true</original></success_info></CampaignResult></CampaignResponse></soap:Body></soap:Envelope>
|
54
|
+
http_version:
|
55
|
+
recorded_at: Tue, 17 Feb 2015 12:00:00 GMT
|
56
|
+
recorded_with: VCR 2.9.3
|
@@ -57,7 +57,7 @@ http_interactions:
|
|
57
57
|
<cake:tags_modification_type>add</cake:tags_modification_type>
|
58
58
|
<cake:conversion_cap_behavior>5</cake:conversion_cap_behavior>
|
59
59
|
<cake:conversion_behavior_on_redirect>5</cake:conversion_behavior_on_redirect>
|
60
|
-
<cake:expiration_date>
|
60
|
+
<cake:expiration_date>2045-02-09T01:00:00</cake:expiration_date>
|
61
61
|
<cake:offer_type_id>3</cake:offer_type_id>
|
62
62
|
<cake:currency_id>2</cake:currency_id>
|
63
63
|
<cake:advertiser_id>15886</cake:advertiser_id>
|
@@ -57,7 +57,7 @@ http_interactions:
|
|
57
57
|
<cake:tags_modification_type>remove_all</cake:tags_modification_type>
|
58
58
|
<cake:conversion_cap_behavior>0</cake:conversion_cap_behavior>
|
59
59
|
<cake:conversion_behavior_on_redirect>0</cake:conversion_behavior_on_redirect>
|
60
|
-
<cake:expiration_date>
|
60
|
+
<cake:expiration_date>2045-02-09T01:00:00</cake:expiration_date>
|
61
61
|
<cake:offer_id>8910</cake:offer_id>
|
62
62
|
<cake:advertiser_id>15886</cake:advertiser_id>
|
63
63
|
<cake:vertical_id>41</cake:vertical_id>
|
@@ -1,6 +1,7 @@
|
|
1
1
|
RSpec.describe SoapyCake::AdminAddedit do
|
2
2
|
around { |example| Timecop.freeze(Time.utc(2015, 2, 17, 12), &example) }
|
3
3
|
|
4
|
+
let(:affiliate_id) { 1 }
|
4
5
|
let(:advertiser_id) { 15886 }
|
5
6
|
let(:contact_id) { 8814 }
|
6
7
|
let(:vertical_id) { 41 }
|
@@ -232,4 +233,31 @@ RSpec.describe SoapyCake::AdminAddedit do
|
|
232
233
|
expect(result[:message]).to eq('Offer Tier Added')
|
233
234
|
end
|
234
235
|
end
|
236
|
+
|
237
|
+
describe 'campaigns' do
|
238
|
+
it 'adds a campaign', :vcr do
|
239
|
+
result = subject.add_campaign(
|
240
|
+
affiliate_id: affiliate_id,
|
241
|
+
offer_id: offer_id,
|
242
|
+
media_type_id: 1,
|
243
|
+
account_status_id: :active,
|
244
|
+
payout: '1.23'
|
245
|
+
)
|
246
|
+
|
247
|
+
expect(result[:message]).to eq('Campaign Created')
|
248
|
+
end
|
249
|
+
|
250
|
+
it 'edits a campaign', :vcr do
|
251
|
+
result = subject.edit_campaign(
|
252
|
+
campaign_id: 123,
|
253
|
+
affiliate_id: affiliate_id,
|
254
|
+
offer_id: offer_id,
|
255
|
+
media_type_id: 1,
|
256
|
+
account_status_id: :active,
|
257
|
+
payout: '1.23'
|
258
|
+
)
|
259
|
+
|
260
|
+
expect(result[:message]).to eq('Campaign Updated')
|
261
|
+
end
|
262
|
+
end
|
235
263
|
end
|
@@ -1,4 +1,6 @@
|
|
1
1
|
RSpec.describe SoapyCake::Admin do
|
2
|
+
around { |example| Timecop.freeze(Time.utc(2015, 6, 15, 12), &example) }
|
3
|
+
|
2
4
|
it 'returns an affiliate with correct data types', :vcr do
|
3
5
|
result = subject.affiliates(affiliate_id: 16027)
|
4
6
|
expect(result.count).to eq(1)
|
@@ -81,4 +83,13 @@ RSpec.describe SoapyCake::Admin do
|
|
81
83
|
tipalti_iframe_expiration_date: nil
|
82
84
|
)
|
83
85
|
end
|
86
|
+
|
87
|
+
it 'returns media types', :vcr do
|
88
|
+
result = subject.media_types
|
89
|
+
|
90
|
+
expect(result.first).to eq(
|
91
|
+
media_type_id: 15,
|
92
|
+
type_name: 'Adware'
|
93
|
+
)
|
94
|
+
end
|
84
95
|
end
|
@@ -121,32 +121,32 @@ RSpec.describe SoapyCake::Admin do
|
|
121
121
|
|
122
122
|
describe '#verticals' do
|
123
123
|
let(:method) { :verticals }
|
124
|
-
let(:cake_opts) {
|
124
|
+
let(:cake_opts) { nil }
|
125
125
|
it_behaves_like 'a cake admin method'
|
126
126
|
end
|
127
127
|
|
128
128
|
describe '#countries' do
|
129
129
|
let(:method) { :countries }
|
130
|
-
let(:cake_opts) {
|
130
|
+
let(:cake_opts) { nil }
|
131
131
|
it_behaves_like 'a cake admin method'
|
132
132
|
end
|
133
133
|
|
134
134
|
describe '#currencies' do
|
135
135
|
let(:method) { :currencies }
|
136
|
-
let(:cake_opts) {
|
136
|
+
let(:cake_opts) { nil }
|
137
137
|
it_behaves_like 'a cake admin method'
|
138
138
|
end
|
139
139
|
|
140
140
|
describe '#tiers' do
|
141
141
|
let(:method) { :tiers }
|
142
142
|
let(:cake_method) { :affiliate_tiers }
|
143
|
-
let(:cake_opts) {
|
143
|
+
let(:cake_opts) { nil }
|
144
144
|
it_behaves_like 'a cake admin method'
|
145
145
|
end
|
146
146
|
|
147
147
|
describe '#blacklist_reasons' do
|
148
148
|
let(:method) { :blacklist_reasons }
|
149
|
-
let(:cake_opts) {
|
149
|
+
let(:cake_opts) { nil }
|
150
150
|
it_behaves_like 'a cake admin method'
|
151
151
|
end
|
152
152
|
end
|
@@ -2,9 +2,9 @@ RSpec.shared_examples_for 'a cake admin method' do
|
|
2
2
|
it 'runs the request' do
|
3
3
|
request = double('request')
|
4
4
|
expect(SoapyCake::Request).to receive(:new)
|
5
|
-
.with(:admin, service, cake_method, cake_opts).and_return(request)
|
5
|
+
.with(:admin, service, cake_method, cake_opts || {}).and_return(request)
|
6
6
|
expect(subject).to receive(:run).with(request)
|
7
7
|
|
8
|
-
subject.public_send(method, cake_opts)
|
8
|
+
subject.public_send(method, *[cake_opts].compact)
|
9
9
|
end
|
10
10
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: soapy_cake
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.9.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: 2015-06-
|
11
|
+
date: 2015-06-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -199,7 +199,10 @@ files:
|
|
199
199
|
- spec/fixtures/vcr_cassettes/SoapyCake_Admin/raises_if_there_is_an_error.yml
|
200
200
|
- spec/fixtures/vcr_cassettes/SoapyCake_Admin/returns_a_clicks_report_with_a_defined_time_range.yml
|
201
201
|
- spec/fixtures/vcr_cassettes/SoapyCake_Admin/returns_an_affiliate_with_correct_data_types.yml
|
202
|
+
- spec/fixtures/vcr_cassettes/SoapyCake_Admin/returns_media_types.yml
|
202
203
|
- spec/fixtures/vcr_cassettes/SoapyCake_AdminAddedit/affiliates/edits_affiliates.yml
|
204
|
+
- spec/fixtures/vcr_cassettes/SoapyCake_AdminAddedit/campaigns/adds_a_campaign.yml
|
205
|
+
- spec/fixtures/vcr_cassettes/SoapyCake_AdminAddedit/campaigns/edits_a_campaign.yml
|
203
206
|
- spec/fixtures/vcr_cassettes/SoapyCake_AdminAddedit/contacts/edits_a_contact.yml
|
204
207
|
- spec/fixtures/vcr_cassettes/SoapyCake_AdminAddedit/geo_targeting/creates_geo_targetings.yml
|
205
208
|
- spec/fixtures/vcr_cassettes/SoapyCake_AdminAddedit/offer_/_offer_contract_caps/updates_a_cap_for_an_offer_contract.yml
|
@@ -249,7 +252,10 @@ test_files:
|
|
249
252
|
- spec/fixtures/vcr_cassettes/SoapyCake_Admin/raises_if_there_is_an_error.yml
|
250
253
|
- spec/fixtures/vcr_cassettes/SoapyCake_Admin/returns_a_clicks_report_with_a_defined_time_range.yml
|
251
254
|
- spec/fixtures/vcr_cassettes/SoapyCake_Admin/returns_an_affiliate_with_correct_data_types.yml
|
255
|
+
- spec/fixtures/vcr_cassettes/SoapyCake_Admin/returns_media_types.yml
|
252
256
|
- spec/fixtures/vcr_cassettes/SoapyCake_AdminAddedit/affiliates/edits_affiliates.yml
|
257
|
+
- spec/fixtures/vcr_cassettes/SoapyCake_AdminAddedit/campaigns/adds_a_campaign.yml
|
258
|
+
- spec/fixtures/vcr_cassettes/SoapyCake_AdminAddedit/campaigns/edits_a_campaign.yml
|
253
259
|
- spec/fixtures/vcr_cassettes/SoapyCake_AdminAddedit/contacts/edits_a_contact.yml
|
254
260
|
- spec/fixtures/vcr_cassettes/SoapyCake_AdminAddedit/geo_targeting/creates_geo_targetings.yml
|
255
261
|
- spec/fixtures/vcr_cassettes/SoapyCake_AdminAddedit/offer_/_offer_contract_caps/updates_a_cap_for_an_offer_contract.yml
|