test/epom/site_test.rb in epom-0.8.5 vs test/epom/site_test.rb in epom-0.9

- old
+ new

@@ -39,11 +39,10 @@ response = Epom::Site.get_site_cpm_threshold_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 Float, first['cpmThreshold'] end end test "get_site_pricing" do timestamp = Time.now.to_i * 1000 @@ -109,10 +108,38 @@ assert_instance_of Hash, response assert_instance_of Fixnum, response['id'] assert response['success'] end + test "get_sites_tree" do + timestamp = Time.now.to_i * 1000 + url_params = {} + body_params = {} + + response = Epom::Site.get_sites_tree(url_params, body_params) + assert_instance_of Array, response + if response.count > 0 + first = response[0] + assert_instance_of Hash, first + assert_instance_of Fixnum, first['id'] + assert_instance_of String, first['name'] + assert_instance_of Array, first['zones'] + if first['zones'].count > 0 + first = first['zones'][0] + assert_instance_of Hash, first + assert_instance_of Fixnum, first['id'] + assert_instance_of Array, first['placements'] + if first['placements'].count > 0 + first = first['placements'][0] + assert_instance_of Hash, first + assert_instance_of Fixnum, first['id'] + assert_instance_of String, first['name'] + end + end + end + end + test "get_sites_zones" do timestamp = Time.now.to_i * 1000 body_params = { :hash => Epom.create_hash(Epom.create_hash(ENV['password']), timestamp), :timestamp => timestamp, @@ -128,8 +155,22 @@ first = response[0] assert_instance_of Fixnum, first['id'] assert_instance_of String, first['name'] end end + + # ***** INCOMPATIBLE WITH set_site_pricing TEST ***** + # test 'update_country_pricing' do + # url_params = { + # :siteId => ENV['site_id'], + # :countryCode => ENV['country_code'] + # } + # body_params = { + # :price => 2.33 + # } + + # response = Epom::Site.update_country_pricing(url_params, body_params) + # assert_not_instance_of Fixnum, response + # end define_get_tests_auto(Epom::Site) end