diff options
author | 6543 <6543@obermui.de> | 2020-09-05 09:43:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-05 08:43:06 +0100 |
commit | dba5d82f86dc9dc757404f03bf80ebbe28a5a0b1 (patch) | |
tree | b59de4d8745ff000d3e4fc9c581ede5abaae6bdf /integrations | |
parent | bab1204db4c6f0b3346a84b3c37fd6386fcee48d (diff) | |
download | gitea-dba5d82f86dc9dc757404f03bf80ebbe28a5a0b1.tar.gz gitea-dba5d82f86dc9dc757404f03bf80ebbe28a5a0b1.zip |
Expose Attachemnt Settings by API (#12514)
close #12368
Diffstat (limited to 'integrations')
-rw-r--r-- | integrations/api_settings_test.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/integrations/api_settings_test.go b/integrations/api_settings_test.go index 3eb8e93044..60dbf7a9dc 100644 --- a/integrations/api_settings_test.go +++ b/integrations/api_settings_test.go @@ -46,4 +46,16 @@ func TestAPIExposedSettings(t *testing.T) { MirrorsDisabled: setting.Repository.DisableMirrors, HTTPGitDisabled: setting.Repository.DisableHTTPGit, }, repo) + + attachment := new(api.GeneralAttachmentSettings) + req = NewRequest(t, "GET", "/api/v1/settings/attachment") + resp = MakeRequest(t, req, http.StatusOK) + + DecodeJSON(t, resp, &attachment) + assert.EqualValues(t, &api.GeneralAttachmentSettings{ + Enabled: setting.Attachment.Enabled, + AllowedTypes: setting.Attachment.AllowedTypes, + MaxFiles: setting.Attachment.MaxFiles, + MaxSize: setting.Attachment.MaxSize, + }, attachment) } |