diff --git a/test/controllers/api/asciicast_controller_test.exs b/test/controllers/api/asciicast_controller_test.exs index a10f0ea..0903767 100644 --- a/test/controllers/api/asciicast_controller_test.exs +++ b/test/controllers/api/asciicast_controller_test.exs @@ -45,6 +45,19 @@ defmodule Asciinema.Api.AsciicastControllerTest do assert List.first(get_resp_header(conn, "location")) =~ @asciicast_url end + test "separate files (pre-v1 params), v0.9.9 client", %{conn: conn} do + asciicast = %{"meta" => fixture(:upload, %{path: "0.9.9/meta.json", + content_type: "application/json"}), + "stdout" => fixture(:upload, %{path: "0.9.9/stdout", + content_type: "application/octet-stream"}), + "stdout_timing" => fixture(:upload, %{path: "0.9.9/stdout.time", + content_type: "application/octet-stream"})} + + conn = post conn, api_asciicast_path(conn, :create), %{"asciicast" => asciicast} + assert text_response(conn, 201) =~ @asciicast_url + assert List.first(get_resp_header(conn, "location")) =~ @asciicast_url + end + test "json file, v1 format", %{conn: conn} do upload = fixture(:upload, %{path: "1/asciicast.json"}) conn = post conn, api_asciicast_path(conn, :create), %{"asciicast" => upload}