       params = generate_payload(context.file_type, context.storage)
       file_path = generate_path()
       storage_id = context.storage.storage_id
-      {:ok, file} = FileController.create(params)
-      {:ok, file} = FileController.move(file, file_path, storage_id)
-
-      assert {:ok, ^file} = FileController.find(file.file_id)
-      assert file_path == file.file_path
+      {:ok, file1} = FileController.create(params)
+      {:ok, file1} = FileController.move(file1, file_path, storage_id)
+      {:ok, file2} = FileController.find(file1.file_id)
+
+      # moved to the correct file_path
+      assert file_path == file1.file_path
+
+      # found file is identical to the one yielded by move
+      assert file1 == file2
     end
 
     test "moves to to another storage", context do
       params = generate_payload(context.file_type, context.storage)
       {:ok, s} = StorageController.create()
-      {:ok, file} = FileController.create(params)
-      {:ok, file} = FileController.move(file, file.file_path, s.storage_id)
-
-      assert {:ok, ^file} = FileController.find(file.file_id)
-      assert s.storage_id == file.storage_id
-    end
-
-    test "fails when file exists", context do
+      {:ok, file1} = FileController.create(params)
+      {:ok, file1} = FileController.move(file1, file1.file_path, s.storage_id)
+      {:ok, file2} = FileController.find(file1.file_id)
+
+      # moved to the correct storage_id
+      assert s.storage_id == file1.storage_id
+
+      # found file is identical to the one yielded by move
+      assert file1 == file2
+    end
+
+    test "move fails on path identity conflict", context do
       params1 = generate_payload(context.file_type, context.storage)
       params2 =
         context.file_type

  end

  describe "file creation" do
    test "holds the correct name", context do
      params = generate_payload(context.file_type, context.storage)
      {:ok, file} = FileController.create(params)

      assert {:ok, ^file} = FileController.find(file.file_id)
      assert params.file_path == file.file_path
    end

    test "uses the correct path", context do
      params = generate_payload(context.file_type, context.storage)
      {:ok, file} = FileController.create(params)

      assert {:ok, ^file} = FileController.find(file.file_id)
      assert params.file_path == file.file_path
    end

    test "uses the correct size", context do
      params = generate_payload(context.file_type, context.storage)
      {:ok, file} = FileController.create(params)

      assert {:ok, ^file} = FileController.find(file.file_id)
      assert params.file_size == file.file_size
    end

    test "uses the correct type", context do
      params = generate_payload(context.file_type, context.storage)
      {:ok, file} = FileController.create(params)

      assert {:ok, ^file} = FileController.find(file.file_id)
      assert params.file_type == file.file_type
    end

    test "is bound to storage", context do
      params = generate_payload(context.file_type, context.storage)
      {:ok, file} = FileController.create(params)

      assert {:ok, ^file} = FileController.find(file.file_id)
      assert context.storage.storage_id == file.storage_id
    end

    test "fails when file exists", context do
      params = generate_payload(context.file_type, context.storage)
      {:ok, _} = FileController.create(params)

      assert {:error, :file_exists} == FileController.create(params)
    end
  end

      params = generate_payload(context.file_type, context.storage)
      file_path = generate_path()
      storage_id = context.storage.storage_id
      {:ok, file1} = FileController.create(params)
      {:ok, file2} = FileController.copy(file1, file_path, storage_id)
      {:ok, file3} = FileController.find(file1.file_id)
      {:ok, file4} = FileController.find(file2.file_id)

      # original file remains unchanged
      assert file1 == file3

      # the new file was copied to the correct file_path
      assert file_path == file2.file_path

      # found file is identical to the one yielded by copy
      assert file2 == file4
    end

    test "copies to another storage", context do
      params = generate_payload(context.file_type, context.storage)
      {:ok, s} = StorageController.create()
      {:ok, file1} = FileController.create(params)
      {:ok, file2} = FileController.copy(file1, file1.file_path, s.storage_id)
      {:ok, file3} = FileController.find(file1.file_id)
      {:ok, file4} = FileController.find(file2.file_id)

      # original file remains unchanged
      assert file1 == file3

      # the new file was copied to the correct file_path
      assert s.storage_id == file2.storage_id

      # found file is identical to the one yielded by copy
      assert file2 == file4
    end

    test "copy fails on path identity conflict", context do
      params1 = generate_payload(context.file_type, context.storage)
      params2 =
        context.file_type
