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:
Lin Jen-Shin 2017-02-14 19:17:36 +08:00
parent d2d30cff55
commit 696a5da7fd
2 changed files with 4 additions and 1 deletions

View File

@ -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

View File

@ -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