Revision 885dd246
Added by Joseph Magen over 10 years ago
test/functional/api/v2/puppetclasses_controller_test.rb | ||
---|---|---|
assert_equal 3, puppetclasses['results'].length
|
||
end
|
||
|
||
test "should show error if optional nested environment does not exist" do
|
||
get :index, {:environment_id => 'nonexistent' }
|
||
assert_response 404
|
||
puppetclasses = ActiveSupport::JSON.decode(@response.body)
|
||
assert_equal "Environment not found by id 'nonexistent'", puppetclasses['message']
|
||
end
|
||
|
||
test "should show puppetclass for host" do
|
||
get :show, { :host_id => hosts(:one).to_param, :id => puppetclasses(:one).id }
|
||
assert_response :success
|
Also available in: Unified diff
fixes #3137 - API v2 - show error if optional nested object does not exist for nested route