Commit 0406a357 authored by Jacob Vosmaer's avatar Jacob Vosmaer

Don't delete files from spec/fixtures

parent ec273b8d
...@@ -17,7 +17,7 @@ describe FileUploader do ...@@ -17,7 +17,7 @@ describe FileUploader do
describe '#image_or_video?' do describe '#image_or_video?' do
context 'given an image file' do context 'given an image file' do
before do before do
@uploader.store!(File.new(Rails.root.join('spec', 'fixtures', 'rails_sample.jpg'))) @uploader.store!(fixture_file_upload(Rails.root.join('spec', 'fixtures', 'rails_sample.jpg')))
end end
it 'detects an image based on file extension' do it 'detects an image based on file extension' do
...@@ -27,7 +27,7 @@ describe FileUploader do ...@@ -27,7 +27,7 @@ describe FileUploader do
context 'given an video file' do context 'given an video file' do
before do before do
video_file = File.new(Rails.root.join('spec', 'fixtures', 'video_sample.mp4')) video_file = fixture_file_upload(Rails.root.join('spec', 'fixtures', 'video_sample.mp4'))
@uploader.store!(video_file) @uploader.store!(video_file)
end end
...@@ -37,7 +37,7 @@ describe FileUploader do ...@@ -37,7 +37,7 @@ describe FileUploader do
end end
it 'does not return image_or_video? for other types' do it 'does not return image_or_video? for other types' do
@uploader.store!(File.new(Rails.root.join('spec', 'fixtures', 'doc_sample.txt'))) @uploader.store!(fixture_file_upload(Rails.root.join('spec', 'fixtures', 'doc_sample.txt')))
expect(@uploader.image_or_video?).to be false expect(@uploader.image_or_video?).to be false
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment