Skip to content
This repository has been archived by the owner on Mar 24, 2020. It is now read-only.

Commit

Permalink
Add send_file support to file_controller_spec
Browse files Browse the repository at this point in the history
  • Loading branch information
mcritchlow committed Jul 9, 2018
1 parent 6503e62 commit d7bd321
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions spec/controllers/file_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

after do
[unit, pub_col, local_col, license_local, otherRights_metadata, otherRights_local].each(&:delete)
# remove localStore test files
system("rm -rf #{Rails.root}/localStore")
end

describe 'public object image download' do
Expand All @@ -35,10 +37,14 @@
obj.add_file(Base64.decode64(jpeg_content), '_2.jpg', 'image_service.jpg')
obj.save
solr_index obj.pid
touch_file(obj.pid, '_1.tif')
touch_file(obj.pid, '_2.jpg')
end

after do
obj.delete
# remove localStore test files
system("rm -rf #{Rails.root}/localStore")
end

describe 'curator' do
Expand Down Expand Up @@ -96,10 +102,16 @@
obj.add_file(Base64.decode64(jpeg_content), '_3.jpg', 'image_medium.jpg')
obj.save
solr_index obj.pid
# setup send_file test files
touch_file(obj.pid, '_1.tif')
touch_file(obj.pid, '_2.jpg')
touch_file(obj.pid, '_3.jpg')
end

after do
obj.delete
# remove localStore test files
system("rm -rf #{Rails.root}/localStore")
end

describe 'curator' do
Expand Down Expand Up @@ -173,10 +185,15 @@
obj.add_file(Base64.decode64(jpeg_content), '_2.jpg', 'image_service.jpg')
obj.save
solr_index obj.pid
# setup send_file test files
touch_file(obj.pid, '_1.tif')
touch_file(obj.pid, '_2.jpg')
end

after do
obj.delete
# remove localStore test files
system("rm -rf #{Rails.root}/localStore")
end

describe 'curator' do
Expand Down Expand Up @@ -233,10 +250,15 @@
obj.add_file(Base64.decode64(jpeg_content), '_2.jpg', 'image_service.jpg')
obj.save
solr_index obj.pid
# setup send_file test files
touch_file(obj.pid, '_1.tif')
touch_file(obj.pid, '_2.jpg')
end

after do
obj.delete
# remove localStore test files
system("rm -rf #{Rails.root}/localStore")
end

describe 'curator' do
Expand Down Expand Up @@ -293,10 +315,15 @@
obj.add_file(Base64.decode64(jpeg_content), '_2.jpg', 'image_service.jpg')
obj.save
solr_index obj.pid
# setup send_file test files
touch_file(obj.pid, '_1.tif')
touch_file(obj.pid, '_2.jpg')
end

after do
obj.delete
# remove localStore test files
system("rm -rf #{Rails.root}/localStore")
end

describe 'curator' do
Expand Down Expand Up @@ -353,10 +380,15 @@
obj.add_file(Base64.decode64(mp3_content), '_2.mp3', 'audio_service.mp3')
obj.save
solr_index obj.pid
# setup send_file test files
touch_file(obj.pid, '_1.wav')
touch_file(obj.pid, '_2.mp3')
end

after do
obj.delete
# remove localStore test files
system("rm -rf #{Rails.root}/localStore")
end

describe 'curator download' do
Expand Down Expand Up @@ -413,10 +445,15 @@
obj.add_file(Base64.decode64(mp3_content), '_2.mp3', 'audio_service.mp3')
obj.save
solr_index obj.pid
# setup send_file test files
touch_file(obj.pid, '_1.wav')
touch_file(obj.pid, '_2.mp3')
end

after do
obj.delete
# remove localStore test files
system("rm -rf #{Rails.root}/localStore")
end

describe 'curator download' do
Expand Down Expand Up @@ -473,10 +510,15 @@
obj.add_file(Base64.decode64(mp4_content), '_2.mp4', 'audio_service.mp4')
obj.save
solr_index obj.pid
# setup send_file test files
touch_file(obj.pid, '_1.mov')
touch_file(obj.pid, '_2.mp4')
end

after do
obj.delete
# remove localStore test files
system("rm -rf #{Rails.root}/localStore")
end

describe 'curator download' do
Expand Down Expand Up @@ -533,10 +575,15 @@
obj.add_file(Base64.decode64(mp4_content), '_2.mp4', 'audio_service.mp4')
obj.save
solr_index obj.pid
# setup send_file test files
touch_file(obj.pid, '_1.mov')
touch_file(obj.pid, '_2.mp4')
end

after do
obj.delete
# remove localStore test files
system("rm -rf #{Rails.root}/localStore")
end

describe 'curator download' do
Expand Down Expand Up @@ -593,10 +640,15 @@
obj.add_file(Base64.decode64(mp3_content), '_2.mp3', 'audio_service.mp3')
obj.save
solr_index obj.pid
# setup send_file test files
touch_file(obj.pid, '_1.wav')
touch_file(obj.pid, '_2.mp3')
end

after do
obj.delete
# remove localStore test files
system("rm -rf #{Rails.root}/localStore")
end

describe 'curator download' do
Expand Down Expand Up @@ -652,10 +704,15 @@
obj.add_file(Base64.decode64(mp4_content), '_2.mp4', 'audio_service.mp4')
obj.save
solr_index obj.pid
# setup send_file test files
touch_file(obj.pid, '_1.mov')
touch_file(obj.pid, '_2.mp4')
end

after do
obj.delete
# remove localStore test files
system("rm -rf #{Rails.root}/localStore")
end

describe 'curator download' do
Expand Down

0 comments on commit d7bd321

Please sign in to comment.