epom 0.4.1 → 0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/epom/advertiser.rb +2 -2
- data/lib/epom/version.rb +1 -1
- data/test/epom/advertiser_test.rb +24 -0
- 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: 9d1aeea62d6468a7d47e5314bbef87b6cf5ce482
|
4
|
+
data.tar.gz: e9bf1571c0b1ac4000e66cb89fb90fa731472bb4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a228bba67baa29469feb6f2b70b61481c5b2a2c959dc2399f7d1003b2dd3f931eae44a9294f6efecf77aa839ca4c34f7654186d58a3a4002d3dd6d0097191ea5
|
7
|
+
data.tar.gz: a47aa911961301f457e4bc2bfd2df08e6da06d0c413f175728fe1ac6d30f44db58ceda62fb2a7d042a2be5f8cd9d1e22a63878488032603825e39eeea5222e9a
|
data/lib/epom/advertiser.rb
CHANGED
@@ -36,8 +36,8 @@ module Epom
|
|
36
36
|
}
|
37
37
|
end
|
38
38
|
|
39
|
-
def self.replace_params_in_url(url,
|
40
|
-
url.gsub!('ADVERTISER_ID',
|
39
|
+
def self.replace_params_in_url(url, url_params)
|
40
|
+
url.gsub!('ADVERTISER_ID', url_params[:advertiserId].to_s) if url.include?('ADVERTISER_ID')
|
41
41
|
url
|
42
42
|
end
|
43
43
|
|
data/lib/epom/version.rb
CHANGED
@@ -83,5 +83,29 @@ class AdvertiserTest < ActiveSupport::TestCase
|
|
83
83
|
response['id']
|
84
84
|
end
|
85
85
|
|
86
|
+
test "update_advertiser" do
|
87
|
+
timestamp = Time.now.to_i * 1000
|
88
|
+
body_params = {
|
89
|
+
:hash => Epom.create_hash(Epom.create_hash(ENV['password']), timestamp),
|
90
|
+
:timestamp => timestamp,
|
91
|
+
:username => ENV['username'],
|
92
|
+
:id => ENV['advertiser_id'],
|
93
|
+
:name => "advertiser #{DateTime.now}",
|
94
|
+
:contactName => "advertiser contactName",
|
95
|
+
:contactEmail => "advertiser@gmail.com",
|
96
|
+
:description => "advertiser description"
|
97
|
+
}
|
98
|
+
|
99
|
+
response = Epom::Advertiser.update_advertiser({}, body_params)
|
100
|
+
assert_instance_of Hash, response
|
101
|
+
assert response['success']
|
102
|
+
assert_instance_of Fixnum, response['id']
|
103
|
+
response['id']
|
104
|
+
end
|
105
|
+
|
106
|
+
test "replace_params_in_url" do
|
107
|
+
assert_equal "/rest-api/advertiser/#{ENV['advertiser_id']}/campaigns.do", Epom::Advertiser.replace_params_in_url('/rest-api/advertiser/ADVERTISER_ID/campaigns.do', {:advertiserId => ENV['advertiser_id']})
|
108
|
+
end
|
109
|
+
|
86
110
|
define_get_tests_auto(Epom::Advertiser)
|
87
111
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: epom
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: '0.5'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pedro Quintero
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-06-
|
13
|
+
date: 2015-06-02 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|