Sha256: 19c4b90fd2d7b7bc43b4345d5a70565524bef20dc0493ee75b996a2c27d5786b

Contents?: true

Size: 1.25 KB

Versions: 6

Compression:

Stored size: 1.25 KB

Contents

require 'test_plugin_helper'

class ForemanBootdisk::HostTest < ActiveSupport::TestCase
  test "#bootdisk_build? must be true when provision_method is bootdisk" do
    host = FactoryGirl.build(:host, :managed)
    host.provision_method = 'bootdisk'
    assert host.bootdisk_build?
    refute host.image_build?
    refute host.pxe_build?
  end

  test "#validate_media? must be true when provision_method is bootdisk" do
    host = FactoryGirl.build(:host, :managed,
                             :provision_method => "bootdisk",
                             :build => true,
                             )
    assert host.validate_media?
  end

  test "#can_be_built? must be true when provision_method is bootdisk" do
    host = FactoryGirl.build(:host, :managed,
                             :provision_method => "bootdisk"
                             )
    assert host.can_be_built?
  end


  test "host should have bootdisk" do
    if unattended?
      h = FactoryGirl.build(:host, :managed,
                            :provision_method => "bootdisk"
                           )
      assert h.bootdisk?
    end
  end

  test "host should not have bootdisk" do
    if unattended?
      h = FactoryGirl.create(:host)
      assert_equal false, h.bootdisk?
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
foreman_bootdisk-8.1.0 test/unit/concerns/host_test.rb
foreman_bootdisk-8.0.2 test/unit/concerns/host_test.rb
foreman_bootdisk-8.0.1 test/unit/concerns/host_test.rb
foreman_bootdisk-7.0.1 test/unit/concerns/host_test.rb
foreman_bootdisk-8.0.0 test/unit/concerns/host_test.rb
foreman_bootdisk-7.0.0 test/unit/concerns/host_test.rb