Revision 9d43fc71
Added by Michael Moll almost 6 years ago
test/functional/api/v2/puppet_hosts_controller_test.rb | ||
---|---|---|
test 'puppetrun routes to /host/:id/puppetrun' do
|
||
assert_routing(
|
||
{ method: 'put', path: '/api/hosts/zzz.com/puppetrun' },
|
||
{ "format"=>"json", "apiv"=>"v2", controller: "api/v2/puppet_hosts", action: "puppetrun", id: "zzz.com" },
|
||
{ "format"=>"json", "apiv"=>"v2" })
|
||
{ "format" => "json", "apiv" => "v2", controller: "api/v2/puppet_hosts", action: "puppetrun", id: "zzz.com" },
|
||
{ "format" => "json", "apiv" => "v2" })
|
||
end
|
||
|
||
test "should run puppet for specific host" do
|
||
as_admin { @phost = FactoryBot.create(:host, :with_puppet) }
|
||
User.current=nil
|
||
User.current = nil
|
||
ProxyAPI::Puppet.any_instance.stubs(:run).returns(true)
|
||
put :puppetrun, params: { :controller => 'puppet_hosts', :id => @phost.id }
|
||
assert_response :success
|
Also available in: Unified diff
Fixes #19789 - fix Layout/SpaceAroundOperators cop