Commit 696a5da7 authored by Lin Jen-Shin's avatar Lin Jen-Shin

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.
parent d2d30cff
...@@ -518,7 +518,8 @@ module Ci ...@@ -518,7 +518,8 @@ module Ci
if expire_in if expire_in
expire_in expire_in
else else
ApplicationSetting.current.default_artifacts_expire_in Gitlab::CurrentSettings.current_application_settings
.default_artifacts_expire_in
end end
self.artifacts_expire_in = value self.artifacts_expire_in = value
......
...@@ -638,6 +638,8 @@ describe Ci::API::Builds do ...@@ -638,6 +638,8 @@ describe Ci::API::Builds do
end end
before do before do
stub_application_setting(default_artifacts_expiration: 0)
post(post_url, post_data, headers_with_token) post(post_url, post_data, headers_with_token)
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment