test/epom/advertiser_test.rb in epom-0.6.2 vs test/epom/advertiser_test.rb in epom-0.7
- old
+ new
@@ -1,20 +1,21 @@
require 'test_helper'
require 'epom/advertiser'
class AdvertiserTest < ActiveSupport::TestCase
+ Epom::EpomElement.login(ENV['username'], ENV['password'])
+
test "truth" do
assert_kind_of Class, Epom::Advertiser
end
test "delete_advertiser" do
advertiser_id = test_create_advertiser()
timestamp = Time.now.to_i * 1000
body_params = {
:hash => Epom.create_hash(Epom.create_hash(ENV['password']), timestamp),
- :timestamp => timestamp,
:username => ENV['username']
}
url_params = {
:advertiserId => advertiser_id
}
@@ -27,11 +28,10 @@
test "get_advertiser_permissions_for_user" do
timestamp = Time.now.to_i * 1000
body_params = {
:hash => Epom.create_hash(Epom.create_hash(ENV['password']), timestamp),
:timestamp => timestamp,
- :username => ENV['username']
}
response = Epom::Advertiser.get_advertiser_permissions_for_user({}, body_params)
assert_instance_of Array, response
if response.count > 0
@@ -44,11 +44,10 @@
end
test "get_campaigns_for_advertiser" do
timestamp = Time.now.to_i * 1000
body_params = {
- :hash => Epom.create_hash(Epom.create_hash(ENV['password']), timestamp),
:timestamp => timestamp,
:username => ENV['username']
}
url_params = {
:advertiserId => ENV['advertiser_id'],
@@ -65,12 +64,9 @@
end
test "create advertiser" do
timestamp = Time.now.to_i * 1000
body_params = {
- :hash => Epom.create_hash(Epom.create_hash(ENV['password']), timestamp),
- :timestamp => timestamp,
- :username => ENV['username'],
:name => "advertiser #{DateTime.now}",
:contactName => "advertiser contactName",
:contactEmail => "advertiser@gmail.com",
:description => "advertiser description"
}
\ No newline at end of file