Delete media items (#20)
* Added method for deleting media files and their content * Adds controllers and methods for deleting media and files * Improved tmpfile setup and teardown for tests * Actually got tmpfile cleanup running once per suite run * Finally fixed flash messages
This commit is contained in:
@@ -32,6 +32,20 @@ defmodule Pinchflat.DataCase do
|
||||
|
||||
setup tags do
|
||||
Pinchflat.DataCase.setup_sandbox(tags)
|
||||
Pinchflat.DataCase.setup_temp_filepaths()
|
||||
:ok
|
||||
end
|
||||
|
||||
@doc """
|
||||
Sets up the temp filepaths for the media and metadata directories.
|
||||
"""
|
||||
def setup_temp_filepaths do
|
||||
File.rm_rf!(Application.get_env(:pinchflat, :media_directory))
|
||||
File.rm_rf!(Application.get_env(:pinchflat, :metadata_directory))
|
||||
|
||||
File.mkdir_p!(Application.get_env(:pinchflat, :media_directory))
|
||||
File.mkdir_p!(Application.get_env(:pinchflat, :metadata_directory))
|
||||
|
||||
:ok
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user