Sha256: b29637afbc21bedd6b6d6e2eb48d76b20ef74d4dcf4d952a4ae81084d603f8c1

Contents?: true

Size: 1.84 KB

Versions: 13

Compression:

Stored size: 1.84 KB

Contents

require 'test_helper'
require 'epom/zone'

class ZoneTest < ActiveSupport::TestCase
	test "truth" do
    assert_kind_of Class, Epom::Zone
  end

  test "create_zone" 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 => "zone #{timestamp}",
      :description => "description",
      :siteId => ENV['site_id']
    }
    url_params = {
    }

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

  test "update_zone" 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 => "zone #{timestamp}",
      :description => "description",
      :zoneId => ENV['zone_id'],
      :siteId => ENV['site_id'] 
    }
    url_params = {
    }

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

  test "get_zone_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'],
    }
    url_params = {
    	:zoneId => ENV['zone_id']
    }

    response = Epom::Zone.get_zone_placement(url_params, body_params)
    assert_instance_of Array, response
    if response.count > 0
    	first = response[0]
    	assert_instance_of Fixnum, first['id']
    	assert_instance_of String, first['name']
    end
  end

  define_get_tests_auto(Epom::Zone)
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
epom-0.9 test/epom/zone_test.rb
epom-0.8.5 test/epom/zone_test.rb
epom-0.8.4 test/epom/zone_test.rb
epom-0.8.1 test/epom/zone_test.rb
epom-0.8 test/epom/zone_test.rb
epom-0.7.2 test/epom/zone_test.rb
epom-0.7 test/epom/zone_test.rb
epom-0.6.2 test/epom/zone_test.rb
epom-0.6 test/epom/zone_test.rb
epom-0.5 test/epom/zone_test.rb
epom-0.4.1 test/epom/zone_test.rb
epom-0.4 test/epom/zone_test.rb
epom-0.3.3 test/epom/zone_test.rb