adzerk 0.2 → 0.3
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 +7 -0
- data/lib/adzerk.rb +4 -0
- data/lib/adzerk/category.rb +34 -0
- data/lib/adzerk/client.rb +20 -8
- data/lib/adzerk/errors.rb +3 -0
- data/lib/adzerk/geo_targeting.rb +32 -0
- data/lib/adzerk/site_zone_targeting.rb +33 -0
- data/lib/adzerk/util.rb +8 -10
- data/lib/adzerk/version.rb +1 -1
- data/test/adtype_api_spec.rb +16 -0
- data/test/advertiser_api_spec.rb +19 -23
- data/test/campaign_api_spec.rb +39 -43
- data/test/category_api_spec.rb +106 -0
- data/test/channel_api_spec.rb +29 -31
- data/test/channel_site_map_api_spec.rb +11 -11
- data/test/creative_api_spec.rb +99 -67
- data/test/creative_map_api_spec.rb +304 -194
- data/test/flight_api_spec.rb +80 -70
- data/test/geo_targeting_api_spec.rb +122 -0
- data/test/invitation_api_spec.rb +6 -6
- data/test/login_api_spec.rb +9 -7
- data/test/priority_api_spec.rb +18 -18
- data/test/publisher_api_spec.rb +15 -77
- data/test/rakefile.rb +5 -1
- data/test/report_api_spec.rb +2 -2
- data/test/security_api_spec.rb +2 -2
- data/test/site_api_spec.rb +15 -15
- data/test/site_zone_targeting_api_spec.rb +134 -0
- data/test/spec_helper.rb +1 -1
- data/test/util_spec.rb +17 -0
- data/test/zone_api_spec.rb +17 -17
- metadata +45 -26
|
@@ -15,7 +15,7 @@ describe "Creative Flight API" do
|
|
|
15
15
|
@zones = client.zones
|
|
16
16
|
|
|
17
17
|
advertiser = @advertisers.create(:title => "test")
|
|
18
|
-
@advertiser_id = advertiser[:id]
|
|
18
|
+
@advertiser_id = advertiser[:id]
|
|
19
19
|
|
|
20
20
|
channel = @channels.create(:title => 'Test Channel ' + rand(1000000).to_s,
|
|
21
21
|
:commission => '0.0',
|
|
@@ -42,7 +42,7 @@ describe "Creative Flight API" do
|
|
|
42
42
|
:is_deleted => false)
|
|
43
43
|
@campaign_id = campaign[:id]
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
new_flight = {
|
|
46
46
|
:no_end_date => false,
|
|
47
47
|
:priority_id => @priority_id,
|
|
48
48
|
:name => 'Test flight ' + rand(1000000).to_s,
|
|
@@ -59,7 +59,8 @@ describe "Creative Flight API" do
|
|
|
59
59
|
:weight_override => nil,
|
|
60
60
|
:campaign_id => @campaign_id,
|
|
61
61
|
:is_active => true,
|
|
62
|
-
:is_deleted => false
|
|
62
|
+
:is_deleted => false,
|
|
63
|
+
:goal_type => 1
|
|
63
64
|
}
|
|
64
65
|
flight = @flights.create(new_flight)
|
|
65
66
|
@flight_id = flight[:id]
|
|
@@ -74,116 +75,203 @@ describe "Creative Flight API" do
|
|
|
74
75
|
end
|
|
75
76
|
|
|
76
77
|
it "should create a creative map" do
|
|
77
|
-
|
|
78
|
+
|
|
78
79
|
$ImageName = "test.jpg"
|
|
79
|
-
|
|
80
|
-
$Body = "Test text"
|
|
81
|
-
$AdvertiserId = $advertiserId
|
|
82
|
-
$CampaignId = $campaignId
|
|
83
|
-
$FlightId = $flightId
|
|
84
|
-
$MapId = 0
|
|
85
|
-
$AdTypeId = 18
|
|
86
|
-
$ZoneId = $zoneId
|
|
87
|
-
$SiteId = $siteId
|
|
80
|
+
|
|
88
81
|
$SizeOverride = false
|
|
89
82
|
$Iframe = false
|
|
90
|
-
$
|
|
91
|
-
$ScriptBody = '<html>'
|
|
92
|
-
$Impressions = 100000
|
|
83
|
+
$Impressions = 10000
|
|
93
84
|
$Percentage = 50
|
|
94
85
|
$DistributionType = 1
|
|
86
|
+
$IsMapActive = true
|
|
87
|
+
$IsMapDeleted = false
|
|
88
|
+
|
|
89
|
+
$Title = 'Test creative ' + rand(1000000).to_s
|
|
90
|
+
$Url = "http://adzerk.com"
|
|
91
|
+
$Body = "Test text"
|
|
92
|
+
$AdTypeId = 18
|
|
95
93
|
$IsHTMLJS = true
|
|
96
|
-
$
|
|
94
|
+
$ScriptBody = '<html></html>'
|
|
95
|
+
$IsCreativeActive = true
|
|
96
|
+
$IsCreativeDeleted = false
|
|
97
97
|
$Alt = "test alt"
|
|
98
|
-
$IsDeleted = false
|
|
99
98
|
$IsSync = false
|
|
100
99
|
|
|
100
|
+
$PublisherAccountId = 372
|
|
101
|
+
|
|
101
102
|
new_creative = {
|
|
102
103
|
:campaign_id => @campaign_id,
|
|
103
104
|
:flight_id => @flight_id,
|
|
104
|
-
:size_override =>
|
|
105
|
-
:iframe =>
|
|
106
|
-
:impressions =>
|
|
107
|
-
:percentage =>
|
|
105
|
+
:size_override => $SizeOverride,
|
|
106
|
+
:iframe => $Iframe,
|
|
107
|
+
:impressions => $Impressions,
|
|
108
|
+
:percentage => $Percentage,
|
|
108
109
|
:siteId => @site_id,
|
|
109
110
|
:zoneId => @zone_id,
|
|
110
|
-
:distributionType =>
|
|
111
|
-
:isActive =>
|
|
112
|
-
:isDeleted =>
|
|
111
|
+
:distributionType => $DistributionType,
|
|
112
|
+
:isActive => $IsMapActive,
|
|
113
|
+
:isDeleted => $IsMapDeleted,
|
|
113
114
|
:creative => {
|
|
114
|
-
:title =>
|
|
115
|
-
:url =>
|
|
116
|
-
:body =>
|
|
115
|
+
:title => $Title,
|
|
116
|
+
:url => $Url,
|
|
117
|
+
:body => $Body,
|
|
117
118
|
:advertiser_id => @advertiser_id,
|
|
118
|
-
:ad_type_id =>
|
|
119
|
-
'IsHTMLJS' =>
|
|
120
|
-
:script_body =>
|
|
121
|
-
:is_active =>
|
|
122
|
-
:
|
|
123
|
-
:
|
|
124
|
-
:is_sync =>
|
|
119
|
+
:ad_type_id => $AdTypeId,
|
|
120
|
+
'IsHTMLJS' => $IsHTMLJS,
|
|
121
|
+
:script_body => $ScriptBody,
|
|
122
|
+
:is_active => $IsCreativeActive,
|
|
123
|
+
:is_deleted => $IsCreativeDeleted,
|
|
124
|
+
:alt => $Alt,
|
|
125
|
+
:is_sync => $IsSync
|
|
125
126
|
}
|
|
126
127
|
}
|
|
127
128
|
creative_map = @creative_maps.create(new_creative)
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
creative_map[:
|
|
132
|
-
creative_map[:
|
|
133
|
-
|
|
134
|
-
creative_map[:
|
|
135
|
-
creative_map[:
|
|
136
|
-
|
|
129
|
+
|
|
130
|
+
# size_override and iframe are left out because they are optional
|
|
131
|
+
# and always return null
|
|
132
|
+
expect(creative_map[:campaign_id]).to eq(@campaign_id)
|
|
133
|
+
expect(creative_map[:flight_id]).to eq(@flight_id)
|
|
134
|
+
#unless distribution type is Fixed (3) this value is ignored
|
|
135
|
+
expect(creative_map[:impressions]).to eq($Impressions)
|
|
136
|
+
expect(creative_map[:percentage]).to eq($Percentage)
|
|
137
|
+
expect(creative_map[:site_id]).to eq(@site_id)
|
|
138
|
+
expect(creative_map[:zone_id]).to eq(@zone_id)
|
|
139
|
+
expect(creative_map[:distribution_type]).to eq($DistributionType)
|
|
140
|
+
expect(creative_map[:is_active]).to eq($IsMapActive)
|
|
141
|
+
expect(creative_map[:is_deleted]).to eq($IsMapDeleted)
|
|
142
|
+
|
|
143
|
+
expect(creative_map[:creative][:title]).to eq($Title)
|
|
144
|
+
expect(creative_map[:creative][:url]).to eq($Url)
|
|
145
|
+
expect(creative_map[:creative][:body]).to eq($Body)
|
|
146
|
+
expect(creative_map[:creative][:advertiser_id]).to eq(@advertiser_id)
|
|
147
|
+
expect(creative_map[:creative][:ad_type_id]).to eq($AdTypeId)
|
|
148
|
+
expect(creative_map[:creative][:is_htmljs]).to eq($IsHTMLJS)
|
|
149
|
+
expect(creative_map[:creative][:script_body]).to eq($ScriptBody)
|
|
150
|
+
expect(creative_map[:creative][:is_active]).to eq($IsCreativeActive)
|
|
151
|
+
expect(creative_map[:creative][:is_deleted]).to eq($IsCreativeDeleted)
|
|
152
|
+
expect(creative_map[:creative][:alt]).to eq($Alt)
|
|
153
|
+
expect(creative_map[:creative][:is_sync]).to eq($IsSync)
|
|
154
|
+
|
|
155
|
+
$creative_id = creative_map[:creative][:id]
|
|
137
156
|
end
|
|
138
157
|
|
|
139
158
|
it "should list all creatives maps for a flight" do
|
|
140
159
|
creative_maps = @creative_maps.list(@flight_id)
|
|
141
160
|
creative_map = creative_maps[:items].last
|
|
142
161
|
$map_id= creative_map[:id]
|
|
143
|
-
|
|
144
|
-
creative_map[:
|
|
145
|
-
creative_map[:
|
|
146
|
-
creative_map[:
|
|
147
|
-
creative_map[:
|
|
148
|
-
creative_map[:site_id].
|
|
149
|
-
creative_map[:
|
|
150
|
-
creative_map[:
|
|
162
|
+
|
|
163
|
+
expect(creative_map[:campaign_id]).to eq(@campaign_id)
|
|
164
|
+
expect(creative_map[:flight_id]).to eq(@flight_id)
|
|
165
|
+
expect(creative_map[:impressions]).to eq($Impressions)
|
|
166
|
+
expect(creative_map[:percentage]).to eq($Percentage)
|
|
167
|
+
expect(creative_map[:site_id]).to eq(@site_id)
|
|
168
|
+
expect(creative_map[:zone_id]).to eq(@zone_id)
|
|
169
|
+
expect(creative_map[:distribution_type]).to eq($DistributionType)
|
|
170
|
+
expect(creative_map[:is_active]).to eq($IsMapActive)
|
|
171
|
+
expect(creative_map[:is_deleted]).to eq($IsMapDeleted)
|
|
172
|
+
|
|
173
|
+
expect(creative_map[:creative][:title]).to eq($Title)
|
|
174
|
+
expect(creative_map[:creative][:url]).to eq($Url)
|
|
175
|
+
expect(creative_map[:creative][:body]).to eq($Body)
|
|
176
|
+
expect(creative_map[:creative][:advertiser_id]).to eq(@advertiser_id)
|
|
177
|
+
expect(creative_map[:creative][:ad_type_id]).to eq($AdTypeId)
|
|
178
|
+
expect(creative_map[:creative][:is_htmljs]).to eq($IsHTMLJS)
|
|
179
|
+
expect(creative_map[:creative][:script_body]).to eq($ScriptBody)
|
|
180
|
+
expect(creative_map[:creative][:is_active]).to eq($IsCreativeActive)
|
|
181
|
+
expect(creative_map[:creative][:is_deleted]).to eq($IsCreativeDeleted)
|
|
182
|
+
expect(creative_map[:creative][:alt]).to eq($Alt)
|
|
183
|
+
expect(creative_map[:creative][:is_sync]).to eq($IsSync)
|
|
151
184
|
end
|
|
152
185
|
|
|
153
186
|
it "should get a specific creative map" do
|
|
154
187
|
creative_map = @creative_maps.get($map_id, @flight_id)
|
|
155
|
-
|
|
156
|
-
creative_map[:
|
|
157
|
-
creative_map[:
|
|
158
|
-
creative_map[:
|
|
159
|
-
creative_map[:
|
|
160
|
-
creative_map[:site_id].
|
|
161
|
-
creative_map[:
|
|
162
|
-
creative_map[:
|
|
188
|
+
|
|
189
|
+
expect(creative_map[:campaign_id]).to eq(@campaign_id)
|
|
190
|
+
expect(creative_map[:flight_id]).to eq(@flight_id)
|
|
191
|
+
expect(creative_map[:impressions]).to eq($Impressions)
|
|
192
|
+
expect(creative_map[:percentage]).to eq($Percentage)
|
|
193
|
+
expect(creative_map[:site_id]).to eq(@site_id)
|
|
194
|
+
expect(creative_map[:zone_id]).to eq(@zone_id)
|
|
195
|
+
expect(creative_map[:distribution_type]).to eq($DistributionType)
|
|
196
|
+
expect(creative_map[:is_active]).to eq($IsMapActive)
|
|
197
|
+
expect(creative_map[:is_deleted]).to eq($IsMapDeleted)
|
|
198
|
+
|
|
199
|
+
expect(creative_map[:creative][:title]).to eq($Title)
|
|
200
|
+
expect(creative_map[:creative][:url]).to eq($Url)
|
|
201
|
+
expect(creative_map[:creative][:body]).to eq($Body)
|
|
202
|
+
expect(creative_map[:creative][:advertiser_id]).to eq(@advertiser_id)
|
|
203
|
+
expect(creative_map[:creative][:ad_type_id]).to eq($AdTypeId)
|
|
204
|
+
expect(creative_map[:creative][:is_htmljs]).to eq($IsHTMLJS)
|
|
205
|
+
expect(creative_map[:creative][:script_body]).to eq($ScriptBody)
|
|
206
|
+
expect(creative_map[:creative][:is_active]).to eq($IsCreativeActive)
|
|
207
|
+
expect(creative_map[:creative][:is_deleted]).to eq($IsCreativeDeleted)
|
|
208
|
+
expect(creative_map[:creative][:alt]).to eq($Alt)
|
|
209
|
+
expect(creative_map[:creative][:is_sync]).to eq($IsSync)
|
|
163
210
|
end
|
|
164
211
|
|
|
165
|
-
it "should update a specific creative" do
|
|
166
|
-
|
|
212
|
+
it "should update a specific creative map" do
|
|
213
|
+
|
|
214
|
+
new_impressions = 1234
|
|
215
|
+
new_percentage = 51
|
|
216
|
+
new_is_active = false
|
|
217
|
+
|
|
218
|
+
updated_creative = {
|
|
167
219
|
:id => $map_id,
|
|
168
220
|
:campaign_id => @campaign_id,
|
|
169
221
|
:flight_id => @flight_id,
|
|
170
|
-
:size_override =>
|
|
171
|
-
:iframe =>
|
|
172
|
-
:impressions =>
|
|
173
|
-
:percentage =>
|
|
222
|
+
:size_override => $SizeOverride,
|
|
223
|
+
:iframe => $iframe,
|
|
224
|
+
:impressions => new_impressions,
|
|
225
|
+
:percentage => new_percentage,
|
|
174
226
|
:site_id => @site_id,
|
|
175
227
|
:zone_id => @zone_id,
|
|
176
|
-
:
|
|
228
|
+
:distribution_type => $DistributionType,
|
|
229
|
+
:is_active => new_is_active,
|
|
177
230
|
:is_deleted => false,
|
|
178
231
|
:creative => {
|
|
179
|
-
:id => $
|
|
232
|
+
:id => $creative_id
|
|
180
233
|
}
|
|
181
234
|
}
|
|
182
235
|
creative_map = @creative_maps.update(updated_creative)
|
|
183
|
-
|
|
236
|
+
|
|
237
|
+
#test new values
|
|
238
|
+
expect(creative_map[:percentage]).to eq(new_percentage)
|
|
239
|
+
expect(creative_map[:impressions]).to eq(new_impressions)
|
|
240
|
+
expect(creative_map[:is_active]).to eq(new_is_active)
|
|
241
|
+
|
|
242
|
+
#make sure old values are unchanged
|
|
243
|
+
expect(creative_map[:campaign_id]).to eq(@campaign_id)
|
|
244
|
+
expect(creative_map[:flight_id]).to eq(@flight_id)
|
|
245
|
+
expect(creative_map[:site_id]).to eq(@site_id)
|
|
246
|
+
expect(creative_map[:zone_id]).to eq(@zone_id)
|
|
247
|
+
expect(creative_map[:distribution_type]).to eq($DistributionType)
|
|
248
|
+
expect(creative_map[:is_deleted]).to eq($IsMapDeleted)
|
|
249
|
+
|
|
250
|
+
expect(creative_map[:creative][:title]).to eq($Title)
|
|
251
|
+
expect(creative_map[:creative][:url]).to eq($Url)
|
|
252
|
+
expect(creative_map[:creative][:body]).to eq($Body)
|
|
253
|
+
expect(creative_map[:creative][:advertiser_id]).to eq(@advertiser_id)
|
|
254
|
+
expect(creative_map[:creative][:ad_type_id]).to eq($AdTypeId)
|
|
255
|
+
expect(creative_map[:creative][:is_htmljs]).to eq($IsHTMLJS)
|
|
256
|
+
expect(creative_map[:creative][:script_body]).to eq($ScriptBody)
|
|
257
|
+
expect(creative_map[:creative][:is_active]).to eq($IsCreativeActive)
|
|
258
|
+
expect(creative_map[:creative][:is_deleted]).to eq($IsCreativeDeleted)
|
|
259
|
+
expect(creative_map[:creative][:alt]).to eq($Alt)
|
|
260
|
+
expect(creative_map[:creative][:is_sync]).to eq($IsSync)
|
|
184
261
|
end
|
|
185
262
|
|
|
186
|
-
it "should update the
|
|
263
|
+
it "should update the nested creative" do
|
|
264
|
+
|
|
265
|
+
new_title = "new title"
|
|
266
|
+
new_url = "http://newurl.com"
|
|
267
|
+
new_body = "new_body"
|
|
268
|
+
new_ad_type_id = 5
|
|
269
|
+
new_script_body = "<html>new body</html>"
|
|
270
|
+
new_is_active = false
|
|
271
|
+
new_alt = "new alt text"
|
|
272
|
+
new_is_sync = true
|
|
273
|
+
new_image_name = "new image name"
|
|
274
|
+
|
|
187
275
|
updated_creative = {
|
|
188
276
|
:id => $map_id,
|
|
189
277
|
:campaign_id => @campaign_id,
|
|
@@ -197,157 +285,179 @@ describe "Creative Flight API" do
|
|
|
197
285
|
:is_active => true,
|
|
198
286
|
:is_deleted => false,
|
|
199
287
|
:creative => {
|
|
200
|
-
:id => $
|
|
201
|
-
:
|
|
288
|
+
:id => $creative_id,
|
|
289
|
+
:title => new_title,
|
|
290
|
+
:url => new_url,
|
|
291
|
+
:body => new_body,
|
|
292
|
+
:advertiser_id => @advertiser_id,
|
|
293
|
+
:ad_type_id => new_ad_type_id,
|
|
294
|
+
'IsHTMLJS' => true,
|
|
295
|
+
:script_body => new_script_body,
|
|
296
|
+
:is_active => new_is_active,
|
|
297
|
+
:alt => new_alt,
|
|
298
|
+
:is_deleted => false,
|
|
299
|
+
:is_sync => new_is_sync,
|
|
300
|
+
:image_name => new_image_name
|
|
202
301
|
}
|
|
203
302
|
}
|
|
204
303
|
creative_map = @creative_maps.update(updated_creative)
|
|
205
|
-
creative_map[:creative][:
|
|
304
|
+
expect(creative_map[:creative][:title]).to eq new_title
|
|
305
|
+
expect(creative_map[:creative][:url]).to eq new_url
|
|
306
|
+
expect(creative_map[:creative][:body]).to eq new_body
|
|
307
|
+
expect(creative_map[:creative][:ad_type_id]).to eq new_ad_type_id
|
|
308
|
+
expect(creative_map[:creative][:script_body]).to eq new_script_body
|
|
309
|
+
expect(creative_map[:creative][:is_active]).to eq new_is_active
|
|
310
|
+
expect(creative_map[:creative][:alt]).to eq new_alt
|
|
311
|
+
expect(creative_map[:creative][:is_sync]).to eq new_is_sync
|
|
312
|
+
expect(creative_map[:creative][:image_name]).to eq new_image_name
|
|
313
|
+
|
|
206
314
|
end
|
|
207
315
|
|
|
208
316
|
it "should delete the creatives after creating it" do
|
|
209
317
|
response = @creative_maps.delete($map_id, @flight_id)
|
|
210
|
-
response.body.
|
|
318
|
+
expect(response.body).to eq("\"This creative map has been deleted\"")
|
|
211
319
|
end
|
|
212
320
|
|
|
213
321
|
it "should not get a map in a different network" do
|
|
214
|
-
|
|
215
|
-
creative_map[:message].should == "This flight is not part of your network"
|
|
322
|
+
expect{ @creative_maps.get(123, @flight_id) }.to raise_error "This flight is not part of your network"
|
|
216
323
|
end
|
|
217
324
|
|
|
218
325
|
it "should not get a map that's been deleted" do
|
|
219
|
-
|
|
220
|
-
creative_map[:message].should == "This creative map has been deleted"
|
|
326
|
+
expect{ @creative_maps.get($map_id, @flight_id) }.to raise_error "This creative map has been deleted"
|
|
221
327
|
end
|
|
222
328
|
|
|
223
329
|
it "should not update a map that's in a different network" do
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
:
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
330
|
+
expect {
|
|
331
|
+
creative_map = @creative_maps.update(
|
|
332
|
+
:id => $map_id,
|
|
333
|
+
:campaign_id => @campaign_id,
|
|
334
|
+
:flight_id => 123,
|
|
335
|
+
:size_override => false,
|
|
336
|
+
:iframe => false,
|
|
337
|
+
:impressions => 200000,
|
|
338
|
+
:percentage => 50,
|
|
339
|
+
:site_id => @site_id,
|
|
340
|
+
:zone_id => @zone_id,
|
|
341
|
+
:is_active => true,
|
|
342
|
+
:is_deleted => false,
|
|
343
|
+
:creative => {
|
|
344
|
+
:id => $creative_id
|
|
345
|
+
}
|
|
346
|
+
)
|
|
347
|
+
}.to raise_error "This flight is not part of your network"
|
|
241
348
|
end
|
|
242
349
|
|
|
243
350
|
it "should not update a map that's been deleted" do
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
:
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
351
|
+
expect {
|
|
352
|
+
creative_map = @creative_maps.update(
|
|
353
|
+
:id => $map_id,
|
|
354
|
+
:campaign_id => @campaign_id,
|
|
355
|
+
:flight_id => @flight_id,
|
|
356
|
+
:size_override => false,
|
|
357
|
+
:iframe => false,
|
|
358
|
+
:impressions => 200000,
|
|
359
|
+
:percentage => 50,
|
|
360
|
+
:site_id => @site_id,
|
|
361
|
+
:zone_id => @zone_id,
|
|
362
|
+
:is_active => true,
|
|
363
|
+
:is_deleted => false,
|
|
364
|
+
:creative => {
|
|
365
|
+
:id => $creative_id
|
|
366
|
+
}
|
|
367
|
+
)
|
|
368
|
+
}.to raise_error "This creative map has been deleted"
|
|
261
369
|
end
|
|
262
370
|
|
|
263
371
|
it "should fail when creating a map for a campaign in a different network" do
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
:
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
372
|
+
expect {
|
|
373
|
+
creative_map = @creative_maps.create(
|
|
374
|
+
:campaign_id => 123,
|
|
375
|
+
:flight_id => @flight_id,
|
|
376
|
+
:size_override => false,
|
|
377
|
+
:iframe => false,
|
|
378
|
+
:impressions => 100000,
|
|
379
|
+
:percentage => 50,
|
|
380
|
+
:siteId => @site_id,
|
|
381
|
+
:zoneId => @zone_id,
|
|
382
|
+
:distributionType => 1,
|
|
383
|
+
:isActive => true,
|
|
384
|
+
:isDeleted => false,
|
|
385
|
+
:creative => {
|
|
386
|
+
:title => "Creative Title",
|
|
387
|
+
:url => "http://www.adzerk.com",
|
|
388
|
+
:body => "Test Body",
|
|
389
|
+
:advertiser_id => @advertiser_id,
|
|
390
|
+
:ad_type_id => 18,
|
|
391
|
+
'IsHTMLJS' => true,
|
|
392
|
+
:script_body => "<html></html>",
|
|
393
|
+
:is_active => true,
|
|
394
|
+
:alt => "alt text",
|
|
395
|
+
:is_deleted => false,
|
|
396
|
+
:is_sync => false
|
|
397
|
+
}
|
|
398
|
+
)
|
|
399
|
+
}.to raise_error "This campaign is not part of your network"
|
|
291
400
|
end
|
|
292
401
|
|
|
293
402
|
it "should fail when creating a map for a site in a different network" do
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
:
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
403
|
+
expect {
|
|
404
|
+
creative_map = @creative_maps.create(
|
|
405
|
+
:campaign_id => @campaign_id,
|
|
406
|
+
:flight_id => @flight_id,
|
|
407
|
+
:size_override => false,
|
|
408
|
+
:iframe => false,
|
|
409
|
+
:impressions => 100000,
|
|
410
|
+
:percentage => 50,
|
|
411
|
+
:siteId => 123,
|
|
412
|
+
:zoneId => @zone_id,
|
|
413
|
+
:distributionType => 1,
|
|
414
|
+
:isActive => true,
|
|
415
|
+
:isDeleted => false,
|
|
416
|
+
:creative => {
|
|
417
|
+
:title => "Creative Title",
|
|
418
|
+
:url => "http://www.adzerk.com",
|
|
419
|
+
:body => "Test Body",
|
|
420
|
+
:advertiser_id => @advertiser_id,
|
|
421
|
+
:ad_type_id => 18,
|
|
422
|
+
'IsHTMLJS' => true,
|
|
423
|
+
:script_body => "<html></html>",
|
|
424
|
+
:is_active => true,
|
|
425
|
+
:alt => "alt text",
|
|
426
|
+
:is_deleted => false,
|
|
427
|
+
:is_sync => false
|
|
428
|
+
}
|
|
429
|
+
)
|
|
430
|
+
}.to raise_error "This site does not belong to your network"
|
|
321
431
|
end
|
|
322
432
|
|
|
323
433
|
it "should fail when creating a map for a zone in a different network" do
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
:
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
434
|
+
expect {
|
|
435
|
+
creative_map = @creative_maps.create(
|
|
436
|
+
:campaign_id => @campaign_id,
|
|
437
|
+
:flight_id => @flight_id,
|
|
438
|
+
:size_override => false,
|
|
439
|
+
:iframe => false,
|
|
440
|
+
:impressions => 100000,
|
|
441
|
+
:percentage => 50,
|
|
442
|
+
:siteId => @site_id,
|
|
443
|
+
:zoneId => 11,
|
|
444
|
+
:distributionType => 1,
|
|
445
|
+
:isActive => true,
|
|
446
|
+
:isDeleted => false,
|
|
447
|
+
:creative => {
|
|
448
|
+
:title => "Creative Title",
|
|
449
|
+
:url => "http://www.adzerk.com",
|
|
450
|
+
:body => "Test Body",
|
|
451
|
+
:advertiser_id => @advertiser_id,
|
|
452
|
+
:ad_type_id => 18,
|
|
453
|
+
'IsHTMLJS' => true,
|
|
454
|
+
:script_body => "<html></html>",
|
|
455
|
+
:is_active => true,
|
|
456
|
+
:alt => "alt text",
|
|
457
|
+
:is_deleted => false,
|
|
458
|
+
:is_sync => false
|
|
459
|
+
}
|
|
460
|
+
)
|
|
461
|
+
}.to raise_error "The site associated with that zone does not belong to your network"
|
|
351
462
|
end
|
|
352
|
-
|
|
353
463
|
end
|