Revision 608e32be
Added by Ondřej Ezr over 2 years ago
test/unit/foreman/http_proxy_test.rb | ||
---|---|---|
test 'when settings are nil' do
|
||
adapter.unstub(:http_proxy)
|
||
adapter.unstub(:http_proxy_except_list)
|
||
Setting::General.stubs(:find_by_name)
|
||
.with('http_proxy').returns(nil)
|
||
Setting::General.stubs(:find_by_name)
|
||
.with('http_proxy_except_list')
|
||
.returns(nil)
|
||
Setting.stubs(:[]).with(:http_proxy).returns(nil)
|
||
Setting.stubs(:[]).with(:http_proxy_except_list).returns(nil)
|
||
refute adapter.proxy_http_request?(nil, request_host, schema)
|
||
end
|
||
|
||
test 'when settings are empty string - after unsetting' do
|
||
adapter.unstub(:http_proxy)
|
||
adapter.unstub(:http_proxy_except_list)
|
||
Setting::General.stubs(:find_by_name)
|
||
.with('http_proxy').returns('')
|
||
Setting::General.stubs(:find_by_name)
|
||
.with('http_proxy_except_list')
|
||
.returns(nil)
|
||
Setting.stubs(:[]).with(:http_proxy).returns('')
|
||
Setting.stubs(:[]).with(:http_proxy_except_list).returns(nil)
|
||
refute adapter.proxy_http_request?(nil, request_host, schema)
|
||
end
|
||
|
Also available in: Unified diff
Fixes #32893 - use setting DSL for General category
This uses our new DSL to define the General settings, this showcases how
to use the new DSL and other categories should follow in the same
release.