diff --git a/app/controllers/hearings/transcription_files_controller.rb b/app/controllers/hearings/transcription_files_controller.rb index aecdf590b02..9701580f50e 100644 --- a/app/controllers/hearings/transcription_files_controller.rb +++ b/app/controllers/hearings/transcription_files_controller.rb @@ -8,7 +8,7 @@ class Hearings::TranscriptionFilesController < ApplicationController # Downloads file and sends to user's local computer def download_transcription_file - tmp_location = file.download_file_from_s3 + tmp_location = file.fetch_file_from_s3! File.open(tmp_location, "r") { |stream| send_data stream.read, filename: file.file_name } file.clean_up_tmp_location end diff --git a/app/models/hearings/transcription_file.rb b/app/models/hearings/transcription_file.rb index efb2c747ffd..6342e0f8fc6 100644 --- a/app/models/hearings/transcription_file.rb +++ b/app/models/hearings/transcription_file.rb @@ -12,7 +12,7 @@ class TranscriptionFile < CaseflowRecord # Purpose: Fetches file from S3 # Return: The temporary save location of the file - def download_file_from_s3 + def fetch_file_from_s3! S3Service.fetch_file(aws_link, tmp_location) tmp_location end diff --git a/spec/models/hearings/transcription_file_spec.rb b/spec/models/hearings/transcription_file_spec.rb index 14e8602b05f..7939dfb3822 100644 --- a/spec/models/hearings/transcription_file_spec.rb +++ b/spec/models/hearings/transcription_file_spec.rb @@ -12,7 +12,7 @@ describe "model functions" do it "downloading a file" do - expect(uploaded_file.download_file_from_s3).to eq("#{Rails.root}/tmp/transcription_files/vtt/transcript.vtt") + expect(uploaded_file.fetch_file_from_s3!).to eq("#{Rails.root}/tmp/transcription_files/vtt/transcript.vtt") end it "uploading a file" do