From f0af5e372fd6ae2fdf98fe472cea5b015d673d53 Mon Sep 17 00:00:00 2001 From: David Zuckerman Date: Mon, 14 Sep 2026 10:17:37 -0700 Subject: [PATCH 1/2] Allowing .mov for tind-spread-validation --- app/lib/tind_spread/tind_validation.rb | 6 +++--- spec/lib/tind_spread/tind_validation_spec.rb | 11 ++++++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/app/lib/tind_spread/tind_validation.rb b/app/lib/tind_spread/tind_validation.rb index 65cf3825..f8345706 100644 --- a/app/lib/tind_spread/tind_validation.rb +++ b/app/lib/tind_spread/tind_validation.rb @@ -64,10 +64,10 @@ def validate_files(row, errors) files_not_found(row, errors) end - # FFT needs to resolve and needs to be either a jpg, pdf, mp3 or mp4 + # FFT needs to resolve and needs to be either a jpg, pdf, mp3, mp4, or mov def validate_fft(key, value, errors) add_error(errors, key, "URL: #{value} inaccessible") unless valid_url?(value) - add_error(errors, key, "URL: #{value} invalid. needs to be .jpg, .pdf, .mp3 or .mp4") unless fft_valid_format?(value) + add_error(errors, key, "URL: #{value} invalid. needs to be .jpg, .pdf, .mp3, .mp4 or .mov") unless fft_valid_format?(value) end # If there is a 500__3 there needs to be a corresponding 500__a @@ -123,7 +123,7 @@ def corresponding_6?(key, row) end def fft_valid_format?(url) - return true if url.downcase.end_with?('.jpg', '.pdf', '.mp3', '.mp4') + return true if url.downcase.end_with?('.jpg', '.pdf', '.mp3', '.mp4', '.mov') false end diff --git a/spec/lib/tind_spread/tind_validation_spec.rb b/spec/lib/tind_spread/tind_validation_spec.rb index b93bd80e..3b54cdcd 100644 --- a/spec/lib/tind_spread/tind_validation_spec.rb +++ b/spec/lib/tind_spread/tind_validation_spec.rb @@ -15,7 +15,7 @@ expected_errors = [ 'header: FFT__a-1 No files found for value', 'header: FFT__a URL: invalid_url inaccessible', - 'header: FFT__a URL: invalid_url invalid. needs to be .jpg, .pdf, .mp3 or .mp4', + 'header: FFT__a URL: invalid_url invalid. needs to be .jpg, .pdf, .mp3, .mp4 or .mov', 'header: 500__3 There is a 500__3 without a corresponding 500__a. Value for 500__3 is value', 'header: 800__6 There is no matching $6 for value value' ] @@ -30,7 +30,7 @@ allow(described_class).to receive(:fft_valid_format?).with('invalid_url').and_return(false) described_class.send(:validate_fft, 'FFT__a', 'invalid_url', errors) expect(errors).to include('header: FFT__a URL: invalid_url inaccessible') - expect(errors).to include('header: FFT__a URL: invalid_url invalid. needs to be .jpg, .pdf, .mp3 or .mp4') + expect(errors).to include('header: FFT__a URL: invalid_url invalid. needs to be .jpg, .pdf, .mp3, .mp4 or .mov') end end @@ -79,7 +79,7 @@ expect(described_class.send(:fft_valid_format?, url)).to be true end - it 'returns false for a URL not ending with .jpg, .pdf, .mp3, .mp4' do + it 'returns false for a URL not ending with .jpg, .pdf, .mp3, .mp4, .mov' do url = 'https://example.com/document.txt' expect(described_class.send(:fft_valid_format?, url)).to be false end @@ -93,6 +93,11 @@ url = 'https://example.com/song.mp4' expect(described_class.send(:fft_valid_format?, url)).to be true end + + it 'returns true for a URL ending with .mov' do + url = 'https://example.com/video.mov' + expect(described_class.send(:fft_valid_format?, url)).to be true + end end describe '.valid_500__3?' do From 0cb789ad27663a0eecff4d1b21dda7570d2ab0aa Mon Sep 17 00:00:00 2001 From: David Zuckerman Date: Mon, 14 Sep 2026 11:34:51 -0700 Subject: [PATCH 2/2] passing array for allowed extensions for tind-spread-validation --- app/lib/tind_spread/tind_validation.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/lib/tind_spread/tind_validation.rb b/app/lib/tind_spread/tind_validation.rb index f8345706..42558225 100644 --- a/app/lib/tind_spread/tind_validation.rb +++ b/app/lib/tind_spread/tind_validation.rb @@ -123,7 +123,7 @@ def corresponding_6?(key, row) end def fft_valid_format?(url) - return true if url.downcase.end_with?('.jpg', '.pdf', '.mp3', '.mp4', '.mov') + return true if url.downcase.end_with?(*%w[.jpg .pdf .mp3 .mp4 .mov]) false end