adzerk 0.2 → 0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -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].to_s
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
- new_flight = {
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
- $Title = 'Test creative ' + rand(1000000).to_s
78
+
78
79
  $ImageName = "test.jpg"
79
- $Url = "http://adzerk.com"
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
- $PublisherAccountId = 372
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
- $IsActive = true
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 => false,
105
- :iframe => false,
106
- :impressions => 100000,
107
- :percentage => 50,
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 => 1,
111
- :isActive => true,
112
- :isDeleted => false,
111
+ :distributionType => $DistributionType,
112
+ :isActive => $IsMapActive,
113
+ :isDeleted => $IsMapDeleted,
113
114
  :creative => {
114
- :title => "Creative Title",
115
- :url => "http://www.adzerk.com",
116
- :body => "Test Body",
115
+ :title => $Title,
116
+ :url => $Url,
117
+ :body => $Body,
117
118
  :advertiser_id => @advertiser_id,
118
- :ad_type_id => 18,
119
- 'IsHTMLJS' => true,
120
- :script_body => "<html></html>",
121
- :is_active => true,
122
- :alt => "alt text",
123
- :is_deleted => false,
124
- :is_sync => false
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
- creative_map[:creative][:title].should eq("Creative Title")
129
- creative_map[:creative][:url].should eq("http://www.adzerk.com")
130
- creative_map[:campaign_id].should eq(@campaign_id)
131
- creative_map[:flight_id].should eq(@flight_id)
132
- creative_map[:zone_id].should eq(@zone_id)
133
- creative_map[:site_id].should eq(@site_id)
134
- creative_map[:creative][:is_htmljs]
135
- creative_map[:creative][:script_body].should eq("<html></html>")
136
- $creative_id_id = creative_map[:creative][:id]
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
- creative_map[:creative][:title].should eq("Creative Title")
144
- creative_map[:creative][:url].should eq("http://www.adzerk.com")
145
- creative_map[:campaign_id].should eq(@campaign_id)
146
- creative_map[:flight_id].should eq(@flight_id)
147
- creative_map[:zone_id].should eq(@zone_id)
148
- creative_map[:site_id].should eq(@site_id)
149
- creative_map[:creative][:is_htmljs]
150
- creative_map[:creative][:script_body].should eq("<html></html>")
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
- creative_map[:creative][:title].should eq("Creative Title")
156
- creative_map[:creative][:url].should eq("http://www.adzerk.com")
157
- creative_map[:campaign_id].should eq(@campaign_id)
158
- creative_map[:flight_id].should eq(@flight_id)
159
- creative_map[:zone_id].should eq(@zone_id)
160
- creative_map[:site_id].should eq(@site_id)
161
- creative_map[:creative][:is_htmljs]
162
- creative_map[:creative][:script_body].should eq("<html></html>")
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
- updated_creative = {
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 => false,
171
- :iframe => false,
172
- :impressions => 200000,
173
- :percentage => 50,
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
- :is_active => true,
228
+ :distribution_type => $DistributionType,
229
+ :is_active => new_is_active,
177
230
  :is_deleted => false,
178
231
  :creative => {
179
- :id => $creative_id_id
232
+ :id => $creative_id
180
233
  }
181
234
  }
182
235
  creative_map = @creative_maps.update(updated_creative)
183
- creative_map[:impressions].should eq(200000)
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 scriptBody tag on a nested creative" do
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 => $creative_id_id,
201
- :script_body => '<html>New Body</html>',
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][:script_body].should eq('<html>New Body</html>')
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.should == "\"This creative map has been deleted\""
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
- creative_map = @creative_maps.get(123, @flight_id)
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
- creative_map = @creative_maps.get($map_id, @flight_id)
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
- creative_map = @creative_maps.update(
225
- :id => $map_id,
226
- :campaign_id => @campaign_id,
227
- :flight_id => 123,
228
- :size_override => false,
229
- :iframe => false,
230
- :impressions => 200000,
231
- :percentage => 50,
232
- :site_id => @site_id,
233
- :zone_id => @zone_id,
234
- :is_active => true,
235
- :is_deleted => false,
236
- :creative => {
237
- :id => $creative_id_id
238
- }
239
- )
240
- creative_map[:message].should == "This flight is not part of your network"
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
- creative_map = @creative_maps.update(
245
- :id => $map_id,
246
- :campaign_id => @campaign_id,
247
- :flight_id => @flight_id,
248
- :size_override => false,
249
- :iframe => false,
250
- :impressions => 200000,
251
- :percentage => 50,
252
- :site_id => @site_id,
253
- :zone_id => @zone_id,
254
- :is_active => true,
255
- :is_deleted => false,
256
- :creative => {
257
- :id => $creative_id_id
258
- }
259
- )
260
- creative_map[:message].should == "This creative map has been deleted"
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
- creative_map = @creative_maps.create(
265
- :campaign_id => 123,
266
- :flight_id => @flight_id,
267
- :size_override => false,
268
- :iframe => false,
269
- :impressions => 100000,
270
- :percentage => 50,
271
- :siteId => @site_id,
272
- :zoneId => @zone_id,
273
- :distributionType => 1,
274
- :isActive => true,
275
- :isDeleted => false,
276
- :creative => {
277
- :title => "Creative Title",
278
- :url => "http://www.adzerk.com",
279
- :body => "Test Body",
280
- :advertiser_id => @advertiser_id,
281
- :ad_type_id => 18,
282
- 'IsHTMLJS' => true,
283
- :script_body => "<html></html>",
284
- :is_active => true,
285
- :alt => "alt text",
286
- :is_deleted => false,
287
- :is_sync => false
288
- }
289
- )
290
- creative_map[:message].should == "This campaign is not part of your network"
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
- creative_map = @creative_maps.create(
295
- :campaign_id => @campaign_id,
296
- :flight_id => @flight_id,
297
- :size_override => false,
298
- :iframe => false,
299
- :impressions => 100000,
300
- :percentage => 50,
301
- :siteId => 123,
302
- :zoneId => @zone_id,
303
- :distributionType => 1,
304
- :isActive => true,
305
- :isDeleted => false,
306
- :creative => {
307
- :title => "Creative Title",
308
- :url => "http://www.adzerk.com",
309
- :body => "Test Body",
310
- :advertiser_id => @advertiser_id,
311
- :ad_type_id => 18,
312
- 'IsHTMLJS' => true,
313
- :script_body => "<html></html>",
314
- :is_active => true,
315
- :alt => "alt text",
316
- :is_deleted => false,
317
- :is_sync => false
318
- }
319
- )
320
- creative_map[:message].should == "This site does not belong to your network"
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
- creative_map = @creative_maps.create(
325
- :campaign_id => @campaign_id,
326
- :flight_id => @flight_id,
327
- :size_override => false,
328
- :iframe => false,
329
- :impressions => 100000,
330
- :percentage => 50,
331
- :siteId => @site_id,
332
- :zoneId => 11,
333
- :distributionType => 1,
334
- :isActive => true,
335
- :isDeleted => false,
336
- :creative => {
337
- :title => "Creative Title",
338
- :url => "http://www.adzerk.com",
339
- :body => "Test Body",
340
- :advertiser_id => @advertiser_id,
341
- :ad_type_id => 18,
342
- 'IsHTMLJS' => true,
343
- :script_body => "<html></html>",
344
- :is_active => true,
345
- :alt => "alt text",
346
- :is_deleted => false,
347
- :is_sync => false
348
- }
349
- )
350
- creative_map[:message].should == "The site associated with that zone does not belong to your network"
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