Project

General

Profile

« Previous | Next » 

Revision feacea35

Added by Amos Benari about 11 years ago

  • ID feacea35f07f362d9e2c694a83516bbc902321a0

upgrade foreman to rails 3.2.13

This commit updates from rails 3.0.x to 3.2.x, main changes include:

  • Asset pipline support
  • cleanup of existing assets (javascript, css, images)

Users who uses foreman in production, make sure that you now compile
your assets, e.g

rake assets:precompile

Paired-with: Joseph Mitchell Magen <>
Paired-with: Ohad Levy <>

Signed-off-by: Ohad Levy <>

View differences:

test/functional/hosts_controller_test.rb
:host => {:name => "myotherfullhost",
:mac => "aabbecddee06",
:ip => "2.3.4.125",
:domain => domains(:mydomain),
:operatingsystem => operatingsystems(:redhat),
:architecture => architectures(:x86_64),
:environment => environments(:production),
:subnet => subnets(:one),
:domain_id => domains(:mydomain).id,
:operatingsystem_id => operatingsystems(:redhat).id,
:architecture_id => architectures(:x86_64).id,
:environment_id => environments(:production).id,
:subnet_id => subnets(:one).id,
:disk => "empty partition",
:puppet_proxy => smart_proxies(:puppetmaster)
:puppet_proxy_id => smart_proxies(:puppetmaster).id
}
}, set_session_user
end
......
assert_difference 'Host.count' do
post :create, { :format => "json", :commit => "Create",
:host => {:name => "myotherfullhost",
:mac => "aabbecddee06",
:mac => "e4:1f:22:cc:36:55",
:ip => "2.3.4.125",
:domain => domains(:mydomain),
:operatingsystem => operatingsystems(:redhat),
:architecture => architectures(:x86_64),
:environment => environments(:production),
:subnet => subnets(:one),
:domain_id => domains(:mydomain).id,
:operatingsystem_id => operatingsystems(:redhat).id,
:architecture_id => architectures(:x86_64).id,
:environment_id => environments(:production).id,
:subnet_id => subnets(:one).id,
:disk => "empty partition",
:puppet_proxy => smart_proxies(:puppetmaster)
:puppet_proxy_id => smart_proxies(:puppetmaster).id
}
}, set_session_user
end
......
test "can change sti type to valid subtype" do
class Host::Valid < Host::Base ; end
put :update, { :commit => "Update", :id => @host.name, :host => {:type => "Host::Valid"} }, set_session_user
@host = Host.find(@host)
@host = Host.find(@host.id)
assert_equal "Host::Valid", @host.type
end
test "cannot change sti type to invalid subtype" do
old_type = @host.type
put :update, { :commit => "Update", :id => @host.name, :host => {:type => "Host::Notvalid"} }, set_session_user
@host = Host.find(@host)
@host = Host.find(@host.id)
assert_equal old_type, @host.type
end
......
@host = Host.create(:name => "myfullhost",
:mac => "aabbecddeeff",
:ip => "2.3.4.99",
:domain => domains(:mydomain),
:operatingsystem => operatingsystems(:redhat),
:architecture => architectures(:x86_64),
:environment => environments(:production),
:subnet => subnets(:one),
:domain_id => domains(:mydomain).id,
:operatingsystem_id => operatingsystems(:redhat).id,
:architecture_id => architectures(:x86_64).id,
:environment_id => environments(:production).id,
:subnet_id => subnets(:one).id,
:disk => "empty partition",
:puppet_proxy => smart_proxies(:puppetmaster)
:puppet_proxy_id => smart_proxies(:puppetmaster).id
)
end
end

Also available in: Unified diff