ApplicationSetting.current doesn't work well in tests
Therefore we prefer `Gitlab::CurrentSettings.current_application_settings` and fix the tests by setting default_artifacts_expire_in to 0 to restore the original behaviour.
This commit is contained in:
parent
d2d30cff55
commit
696a5da7fd
|
@ -518,7 +518,8 @@ module Ci
|
|||
if expire_in
|
||||
expire_in
|
||||
else
|
||||
ApplicationSetting.current.default_artifacts_expire_in
|
||||
Gitlab::CurrentSettings.current_application_settings
|
||||
.default_artifacts_expire_in
|
||||
end
|
||||
|
||||
self.artifacts_expire_in = value
|
||||
|
|
|
@ -638,6 +638,8 @@ describe Ci::API::Builds do
|
|||
end
|
||||
|
||||
before do
|
||||
stub_application_setting(default_artifacts_expiration: 0)
|
||||
|
||||
post(post_url, post_data, headers_with_token)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue