Sha256: 6b8d19fb8b79a8f69119335dee6072e04a8a999bc7eb4493a4e5d8fcb5f20886

Contents?: true

Size: 1.04 KB

Versions: 2

Compression:

Stored size: 1.04 KB

Contents

require 'test_helper'

class EpomTest < ActiveSupport::TestCase
  test "truth" do
    assert_kind_of Module, Epom
  end

  test "get_targeting" 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 = {
      :bannerId => ENV['banner_id'],
      :targetId => ENV['target_id']
    }

    response = Epom::Banner.get_targeting(url_params, body_params)
    assert_instance_of Hash, response
  end

  test "set_site_pricing" do
    timestamp = Time.now.to_i * 1000
    url_params = {
      :hash => Epom.create_hash(Epom.create_hash(ENV['password']), timestamp),
      :timestamp => timestamp, 
      :username => ENV['username'],
      :siteId => ENV['site_id']
    }
    body_params = '{"paymentModel":"FIXED_PRICE","pricingType":"CPM","price":4.2}'

    response = Epom::Site.set_site_pricing(url_params, body_params)
    assert_instance_of Hash, response
    assert response['success']
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
epom-0.3 test/epom_test.rb
epom-0.1.0 test/epom_test.rb