adroller 1.0.1 → 1.0.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cedb44177417ea5df338ad7606183a75320e7de3
4
- data.tar.gz: 16572ac4803bf542abdc875a891bfda6ab159734
3
+ metadata.gz: 41aa6e068923eec31c9f33f44d238762623f312c
4
+ data.tar.gz: 5b7be01dbbe586139a659007a723f41525f442a6
5
5
  SHA512:
6
- metadata.gz: 49046ddc00a006459d6dcad0da560f670c9efc9b21a602547d38547779dd18d441b0e60593c6c3c0e8386eaf0dfb4485e954aaa016223d8ee5a282068ddf10ff
7
- data.tar.gz: e68531c7d30df3d6db23f749b84189f1f329ed0f74a8bad28dfa4174194c67daf5bce741c86bc50853f2619d6cd449c2f58de9ed77a1c209c5b7f15c96f24ca5
6
+ metadata.gz: f308d9dc7e58844b01051e645168fb2657dff7ae38aaa569063868222f4b790e437003d0614dd3d27d92b1c27551abf6fcd67926269e40212b17f867ce3fb98c
7
+ data.tar.gz: deacb2912662787a3e9ff752c5ea2c75bf5116dad4b43ce451bcd56a8bd1a032a88e4869fbd1b2373470503c22f3a4df833c9c20de0fcf59c4a7291ee7cb1e94
@@ -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
- response = HTTParty.send(request_method, request_uri,
16
- basic_auth: basic_auth, query: query_params)
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).fetch('results', {})
24
+ JSON.parse(response.body)
20
25
  rescue JSON::ParserError
21
26
  { error: 'JSON::ParserError', response: response.body }
22
27
  end
@@ -1,3 +1,3 @@
1
1
  module Adroller
2
- VERSION = '1.0.1'
2
+ VERSION = '1.0.2'
3
3
  end
@@ -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(query: params)
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(query: params)
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(query: params)
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(query: escaped_params)
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(query: escaped_params)
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.1
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-10 00:00:00.000000000 Z
11
+ date: 2015-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler