Sha256: c5ec8b84869aac7ff7289b693e7456371563dfc3b9db465d8b80f35ce19c58a8

Contents?: true

Size: 1.61 KB

Versions: 2

Compression:

Stored size: 1.61 KB

Contents

require 'test_helper'
require 'epom/placement'

class PlacementTest < ActiveSupport::TestCase
	test "truth" do
    assert_kind_of Class, Epom::Placement
  end

  test "get_placement_summary" do
  	timestamp = Time.now.to_i * 1000
    body_params = {
  		:hash => Epom.create_hash(Epom.create_hash(ENV['password']), timestamp),
  		:timestamp => timestamp, 
  		:username => ENV['username'],
      :placementIds => ENV['placement_id']
    }
    url_params = {}

  	response = Epom::Placement.get_placement_summary(url_params, body_params)
    assert_instance_of Array, response
    if response.count > 0
      first = response.first
      assert_instance_of Hash, first
      assert_instance_of Fixnum, first['id']
      assert_instance_of Array, first['category']
      assert_instance_of String, first['name']
      assert_instance_of String, first['key']
      assert_instance_of String, first['size']
      assert_instance_of Fixnum, first['zoneId']
    end
  end

  test "create_standard_placement" do
    timestamp = Time.now.to_i * 1000
    body_params = {
      :hash => Epom.create_hash(Epom.create_hash(ENV['password']), timestamp),
      :timestamp => timestamp, 
      :username => ENV['username'],
      :zoneId => ENV['zone_id'],
      :type => Epom::PlacementType::SITE_PLACEMENT,
      :name => "placement #{timestamp}",
      :adUnitId => 10,
      'size.height' => 200,
      'size.width' => 350,
    }
    url_params = {}

    response = Epom::Placement.create_standard_placement(url_params, body_params)
    assert_instance_of Hash, response
    assert_instance_of Fixnum, response['id']
    assert response['success']
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

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