Revision 45831c5a
Added by Marek Hulán about 8 years ago
test/functional/api/v2/hosts_controller_test.rb | ||
---|---|---|
assert_response :unprocessable_entity
|
||
end
|
||
|
||
test "when no primary interface is set, defaulting to first one" do
|
||
disable_orchestration
|
||
nics = nics_attrs
|
||
nics.each do |nic|
|
||
nic.delete(:primary)
|
||
end
|
||
post :create, { :host => basic_attrs.merge!(:interfaces_attributes => nics) }
|
||
|
||
assert_response :created
|
||
end
|
||
|
||
test 'when ":restrict_registered_smart_proxies" is false, HTTP requests should be able to import facts' do
|
||
User.current = users(:one) #use an unprivileged user, not apiadmin
|
||
Setting[:restrict_registered_smart_proxies] = false
|
Also available in: Unified diff
Fixes #14264 - improve primary interface selection
(cherry picked from commit 308f611d9bb17173588a6f59c7a914b551923a7b)