Sha256: 40cf2d245b0c1591525b4b5ac38fd9757ac3b1ca77bba3851ae2858f421082b3
Contents?: true
Size: 1.15 KB
Versions: 8
Compression:
Stored size: 1.15 KB
Contents
require_relative 'helper' class DomainTest < MiniTest::Unit::TestCase def test_build_domain domain = MxHero::API::Domain.new data assert_equal data[:domain], domain.domain assert_equal data[:features].first[:feature], domain.features.first.component assert_equal DateTime.strptime(data[:cosLastChange].to_s, '%Q'), domain.cos_last_change assert domain.cos.is_a? MxHero::API::Cos assert_equal data[:cos][:cos], domain.cos.type assert_equal data[:source], domain.source assert_equal data[:inbound], true assert_equal data[:outbound], false end def test_empty_metadata [ '', 'null', nil ].each do |value| data[:metadata] = value domain = MxHero::API::Domain.new data assert domain.metadata.nil?, "Is not empty in case of '#{value}'" end end def test_change_domain_to_trial domain = MxHero::API::Domain.new data domain.change_to_trial assert_equal 'trial', domain.cos.type domain = MxHero::API::Domain.new data.merge(cos: { cos: "post_trial", edition: nil }) domain.change_to_trial assert_equal 'post_trial', domain.cos.type end def data Fixtures::Domain.data end end
Version data entries
8 entries across 8 versions & 1 rubygems