Revision fc053564
Added by Dominic Cleal over 7 years ago
test/controllers/hosts_controller_test.rb | ||
---|---|---|
assert_response :success
|
||
response = JSON.parse @response.body
|
||
assert_equal({"id" => @host.id, "state" => "na", "title" => 'N/A',
|
||
"statusText" => "Power operation are not enabled on this host."}, response)
|
||
"statusText" => "Power operations are not enabled on this host."}, response)
|
||
end
|
||
|
||
test 'show power status for a host that has an exception' do
|
||
... | ... | |
assert_response :success
|
||
response = JSON.parse @response.body
|
||
assert_equal({"id" => @host.id, "state" => "na", "title" => "N/A",
|
||
"statusText" => "Failed to fetch power status ERF42-9958 [Foreman::Exception]: Unknown power management support - can't continue"}, response)
|
||
"statusText" => "Failed to fetch power status: ERF42-9958 [Foreman::Exception]: Unknown power management support - can't continue"}, response)
|
||
end
|
||
|
||
test 'do not provide power state on an unknown host' do
|
Also available in: Unified diff
refs #14688 - correct i18n extraction for all new power methods
- HOST_POWER being translated at the class level, not in action context
- messages with variables interpolated prior to i18n lookup
- timeout message being translated without prior extraction