Created
November 4, 2014 15:59
-
-
Save GregSutcliffe/bb5dff100ebe98ab7392 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/app/models/host/managed.rb b/app/models/host/managed.rb | |
| index 63eb14b..e2719bb 100644 | |
| --- a/app/models/host/managed.rb | |
| +++ b/app/models/host/managed.rb | |
| @@ -141,6 +141,7 @@ class Host::Managed < Host::Base | |
| delegate :dns?, :reverse_dns?, :dns_a_record, :dns_ptr_record, :to => :primary_interface | |
| include Orchestration::Compute | |
| # include Orchestration::TFTP | |
| + include Rails.application.routes.url_helpers | |
| delegate :tftp?, :tftp, :generate_pxe_template, :to => :provision_interface | |
| include Orchestration::Puppetca | |
| include Orchestration::SSHProvision | |
| diff --git a/test/unit/host_build_status_test.rb b/test/unit/host_build_status_test.rb | |
| index 6bef678..66dd95a 100644 | |
| --- a/test/unit/host_build_status_test.rb | |
| +++ b/test/unit/host_build_status_test.rb | |
| @@ -5,11 +5,11 @@ class HostBuildStatusTest < ActiveSupport::TestCase | |
| setup do | |
| User.current = users(:admin) | |
| - host = Host.new(:name => "myfullhost", :mac => "aabbecddeeff", :ip => "2.3.4.03", :ptable => ptables(:one), :medium => media(:one), | |
| + @host = Host.new(:name => "myfullhost", :mac => "aabbecddeeff", :ip => "2.3.4.03", :ptable => ptables(:one), :medium => media(:one), | |
| :domain => domains(:mydomain), :operatingsystem => operatingsystems(:redhat), :subnet => subnets(:one), :puppet_proxy => smart_proxies(:puppetmaster), | |
| :subnet => subnets(:one), :architecture => architectures(:x86_64), :environment => environments(:production), :managed => true, | |
| :owner_type => "User", :root_pass => "xybxa6JUkz63w") | |
| - @build = host.build_status | |
| + @build = @host.build_status | |
| # bypass host.valid? | |
| HostBuildStatus.any_instance.stubs(:host_status).returns(true) | |
| end | |
| @@ -19,7 +19,7 @@ class HostBuildStatusTest < ActiveSupport::TestCase | |
| end | |
| test "should fail rendering a template" do | |
| - host = FactoryGirl.create(:host, :managed) | |
| + host = @host | |
| kind = FactoryGirl.create(:template_kind) | |
| config_template = FactoryGirl.create(:config_template, :template => "provision script <%= @foreman.server.status %>",:name => "My Failed Template", :template_kind => kind, :operatingsystem_ids => [host.operatingsystem_id], :environment_ids => [host.environment_id], :hostgroup_ids => [host.hostgroup_id] ) | |
| @build = host.build_status |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment