Sha256: 52c927042e3a769f46e94e004104637fd45e12e83c2971a29d4523da7d7ce800

Contents?: true

Size: 1.65 KB

Versions: 20

Compression:

Stored size: 1.65 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

  define_get_tests_auto(Epom::Placement)
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
epom-0.9.9 test/epom/placement_test.rb
epom-0.9.8 test/epom/placement_test.rb
epom-0.9.7 test/epom/placement_test.rb
epom-0.9.6 test/epom/placement_test.rb
epom-0.9.4 test/epom/placement_test.rb
epom-0.9.2 test/epom/placement_test.rb
epom-0.9.1 test/epom/placement_test.rb
epom-0.9 test/epom/placement_test.rb
epom-0.8.5 test/epom/placement_test.rb
epom-0.8.4 test/epom/placement_test.rb
epom-0.8.1 test/epom/placement_test.rb
epom-0.8 test/epom/placement_test.rb
epom-0.7.2 test/epom/placement_test.rb
epom-0.7 test/epom/placement_test.rb
epom-0.6.2 test/epom/placement_test.rb
epom-0.6 test/epom/placement_test.rb
epom-0.5 test/epom/placement_test.rb
epom-0.4.1 test/epom/placement_test.rb
epom-0.4 test/epom/placement_test.rb
epom-0.3.3 test/epom/placement_test.rb