adroller 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/adroll/service.rb +8 -3
- data/lib/adroller/version.rb +1 -1
- data/spec/lib/adroll/ad_spec.rb +4 -4
- data/spec/lib/adroll/advertisable_spec.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 41aa6e068923eec31c9f33f44d238762623f312c
|
4
|
+
data.tar.gz: 5b7be01dbbe586139a659007a723f41525f442a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f308d9dc7e58844b01051e645168fb2657dff7ae38aaa569063868222f4b790e437003d0614dd3d27d92b1c27551abf6fcd67926269e40212b17f867ce3fb98c
|
7
|
+
data.tar.gz: deacb2912662787a3e9ff752c5ea2c75bf5116dad4b43ce451bcd56a8bd1a032a88e4869fbd1b2373470503c22f3a4df833c9c20de0fcf59c4a7291ee7cb1e94
|
data/lib/adroll/service.rb
CHANGED
@@ -12,11 +12,16 @@ module AdRoll
|
|
12
12
|
def self.call_api(request_method, endpoint, query_params)
|
13
13
|
request_uri = File.join(service_url, endpoint.to_s)
|
14
14
|
|
15
|
-
|
16
|
-
|
15
|
+
if request_method == :get
|
16
|
+
response = HTTParty.send(request_method, request_uri,
|
17
|
+
basic_auth: basic_auth, query: query_params, debug_output: $stdout)
|
18
|
+
else
|
19
|
+
response = HTTParty.send(request_method, request_uri,
|
20
|
+
basic_auth: basic_auth, body: query_params, debug_output: $stdout)
|
21
|
+
end
|
17
22
|
|
18
23
|
begin
|
19
|
-
JSON.parse(response.body)
|
24
|
+
JSON.parse(response.body)
|
20
25
|
rescue JSON::ParserError
|
21
26
|
{ error: 'JSON::ParserError', response: response.body }
|
22
27
|
end
|
data/lib/adroller/version.rb
CHANGED
data/spec/lib/adroll/ad_spec.rb
CHANGED
@@ -19,7 +19,7 @@ describe AdRoll::Api::Ad do
|
|
19
19
|
|
20
20
|
it 'calls the api with the correct params' do
|
21
21
|
subject.clone(name: 'name', headline: 'headline', body: 'body')
|
22
|
-
expect(WebMock).to have_requested(:post, request_uri).with(
|
22
|
+
expect(WebMock).to have_requested(:post, request_uri).with(body: params)
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
@@ -28,13 +28,13 @@ describe AdRoll::Api::Ad do
|
|
28
28
|
let!(:params) do
|
29
29
|
{ advertisable: 'advertisable',
|
30
30
|
file: 'ANBLE5432',
|
31
|
-
dynamic_template_id: 1
|
31
|
+
dynamic_template_id: '1'
|
32
32
|
}
|
33
33
|
end
|
34
34
|
|
35
35
|
it 'calls the api with the correct params' do
|
36
36
|
subject.create(advertisable: 'advertisable', file: 'ANBLE5432', dynamic_template_id: 1)
|
37
|
-
expect(WebMock).to have_requested(:post, request_uri).with(
|
37
|
+
expect(WebMock).to have_requested(:post, request_uri).with(body: params)
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
@@ -46,7 +46,7 @@ describe AdRoll::Api::Ad do
|
|
46
46
|
|
47
47
|
it 'calls the api with the correct params' do
|
48
48
|
subject.edit(ad: 'AD123')
|
49
|
-
expect(WebMock).to have_requested(:put, request_uri).with(
|
49
|
+
expect(WebMock).to have_requested(:put, request_uri).with(body: params)
|
50
50
|
end
|
51
51
|
end
|
52
52
|
|
@@ -26,7 +26,7 @@ describe AdRoll::Api::Advertisable do
|
|
26
26
|
|
27
27
|
it 'calls the api with the correct params' do
|
28
28
|
subject.create(params)
|
29
|
-
expect(WebMock).to have_requested(:post, request_uri).with(
|
29
|
+
expect(WebMock).to have_requested(:post, request_uri).with(body: escaped_params)
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
@@ -39,7 +39,7 @@ describe AdRoll::Api::Advertisable do
|
|
39
39
|
name: 'advertisable test',
|
40
40
|
url: 'https://url.com',
|
41
41
|
product_name: 'product_name',
|
42
|
-
view_through_conversion_window: 30
|
42
|
+
view_through_conversion_window: '30'
|
43
43
|
}
|
44
44
|
end
|
45
45
|
|
@@ -50,7 +50,7 @@ describe AdRoll::Api::Advertisable do
|
|
50
50
|
|
51
51
|
it 'calls the api with the correct params' do
|
52
52
|
subject.edit(params)
|
53
|
-
expect(WebMock).to have_requested(:put, request_uri).with(
|
53
|
+
expect(WebMock).to have_requested(:put, request_uri).with(body: escaped_params)
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: adroller
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nikolas Davis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|