From f727df5c845e2927eb66adf0f45ab0914bfa8b63 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Thu, 1 Jun 2017 09:52:19 +0200 Subject: Add missing specs --- lib/api/helpers.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/api/helpers.rb') diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb index d61450f8258..81f6fc3201d 100644 --- a/lib/api/helpers.rb +++ b/lib/api/helpers.rb @@ -311,6 +311,16 @@ module API end end + def present_artifacts!(artifacts_file) + return not_found! unless artifacts_file.exists? + + if artifacts_file.file_storage? + present_file!(artifacts_file.path, artifacts_file.filename) + else + redirect_to(artifacts_file.url) + end + end + private def private_token -- cgit v1.2.1