adzerk 0.12 → 0.13
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/lib/adzerk/client.rb +2 -1
- data/lib/adzerk/version.rb +1 -1
- data/test/campaign_api_spec.rb +3 -1
- data/test/login_api_spec.rb +11 -3
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 45256e26c1df6bc024eb079d454aa60403c11578
|
|
4
|
+
data.tar.gz: 3ee03c68d83208ff84b71a2331b15041ba822b56
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f3e19e1997bdfe16fa887c5834716de82fcddc76b47f86e4d7af7f3f51690ce105e95f76d7e88be4fed3446642792115e4819963d4b167cf1b4741e5f885f6e5
|
|
7
|
+
data.tar.gz: 23fe705e697ca32fc9ebc3dc1c5ef5162fd5921ae7c6c8b58c8051e2358d7fdc2b5e3f94801cc1bb93f68689980bd5e62c6f9d6fe2125393d73f5e29922e17bc
|
data/lib/adzerk/client.rb
CHANGED
|
@@ -85,7 +85,8 @@ module Adzerk
|
|
|
85
85
|
response = http.request(request)
|
|
86
86
|
if response.kind_of? Net::HTTPClientError
|
|
87
87
|
error_response = JSON.parse(response.body)
|
|
88
|
-
|
|
88
|
+
msg = error_response["message"] || error_response["Error"]
|
|
89
|
+
raise Adzerk::ApiError.new(msg)
|
|
89
90
|
end
|
|
90
91
|
response
|
|
91
92
|
end
|
data/lib/adzerk/version.rb
CHANGED
data/test/campaign_api_spec.rb
CHANGED
|
@@ -154,7 +154,9 @@ describe "Campaign API" do
|
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
expect{ @campaigns.create(new_campaign) }.to raise_error("This advertiser is not part of your network")
|
|
157
|
+
end
|
|
157
158
|
|
|
159
|
+
it "should not update a campaign with a new advertiserId" do
|
|
158
160
|
updated_campaign = {
|
|
159
161
|
:id => $campaign_id,
|
|
160
162
|
:name => 'Test campaign ' + rand(1000000).to_s,
|
|
@@ -167,7 +169,7 @@ describe "Campaign API" do
|
|
|
167
169
|
:is_deleted => false
|
|
168
170
|
}
|
|
169
171
|
|
|
170
|
-
expect{ @campaigns.update(updated_campaign) }.to raise_error("This advertiser
|
|
172
|
+
expect{ @campaigns.update(updated_campaign) }.to raise_error("This campaign belongs to advertiser #{$advertiserId}; a different advertiser cannot be specified.")
|
|
171
173
|
end
|
|
172
174
|
|
|
173
175
|
it "should not retrieve a campaign with a advertiserId that doesn't belong to it" do
|
data/test/login_api_spec.rb
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
|
2
2
|
|
|
3
|
+
def random_email
|
|
4
|
+
"test@email-#{rand(1000000)}.com"
|
|
5
|
+
end
|
|
6
|
+
|
|
3
7
|
describe "Login_API" do
|
|
4
8
|
|
|
5
9
|
before do
|
|
@@ -7,13 +11,14 @@ describe "Login_API" do
|
|
|
7
11
|
end
|
|
8
12
|
|
|
9
13
|
it "should create a new login" do
|
|
10
|
-
email =
|
|
14
|
+
email = random_email()
|
|
11
15
|
login = @logins.create(:email => email,
|
|
12
16
|
:password => '1234567',
|
|
13
17
|
:name => "John Doe")
|
|
14
18
|
$login_id = login[:id]
|
|
15
19
|
expect(login[:email]).to eq(email)
|
|
16
|
-
|
|
20
|
+
# Password is redacted in the response.
|
|
21
|
+
expect(login[:password]).to eq("")
|
|
17
22
|
expect(login[:name]).to eq("John Doe")
|
|
18
23
|
end
|
|
19
24
|
|
|
@@ -28,9 +33,12 @@ describe "Login_API" do
|
|
|
28
33
|
end
|
|
29
34
|
|
|
30
35
|
it "should update a login" do
|
|
36
|
+
new_email = random_email()
|
|
31
37
|
login = @logins.update(:id => $login_id,
|
|
32
|
-
:name => "New Name"
|
|
38
|
+
:name => "New Name",
|
|
39
|
+
:email => new_email)
|
|
33
40
|
expect(login[:name]).to eq("New Name")
|
|
41
|
+
expect(login[:email]).to eq(new_email)
|
|
34
42
|
end
|
|
35
43
|
|
|
36
44
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: adzerk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: '0.
|
|
4
|
+
version: '0.13'
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kacy Fortner
|
|
@@ -17,7 +17,7 @@ authors:
|
|
|
17
17
|
autorequire:
|
|
18
18
|
bindir: bin
|
|
19
19
|
cert_chain: []
|
|
20
|
-
date: 2017-
|
|
20
|
+
date: 2017-10-19 00:00:00.000000000 Z
|
|
21
21
|
dependencies:
|
|
22
22
|
- !ruby/object:Gem::Dependency
|
|
23
23
|
name: rspec
|
|
@@ -81,14 +81,14 @@ dependencies:
|
|
|
81
81
|
requirements:
|
|
82
82
|
- - "~>"
|
|
83
83
|
- !ruby/object:Gem::Version
|
|
84
|
-
version: '
|
|
84
|
+
version: '5.1'
|
|
85
85
|
type: :runtime
|
|
86
86
|
prerelease: false
|
|
87
87
|
version_requirements: !ruby/object:Gem::Requirement
|
|
88
88
|
requirements:
|
|
89
89
|
- - "~>"
|
|
90
90
|
- !ruby/object:Gem::Version
|
|
91
|
-
version: '
|
|
91
|
+
version: '5.1'
|
|
92
92
|
description: Ruby library for the Adzerk API
|
|
93
93
|
email: engineering@adzerk.com
|
|
94
94
|
executables: []
|