                                                           content_type: "application/octet-stream"})}
 
       conn = post conn, api_asciicast_path(conn, :create), %{"asciicast" => asciicast}
-      assert text_response(conn, 201) =~ @asciicast_url
+      assert text_response(conn, 201) =~ @successful_response
       assert List.first(get_resp_header(conn, "location")) =~ @asciicast_url
     end
 

                                                          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}
      assert text_response(conn, 201) =~ @asciicast_url
      assert List.first(get_resp_header(conn, "location")) =~ @asciicast_url
    end

    test "json file, v2 format", %{conn: conn} do
      upload = fixture(:upload, %{path: "2/minimal.cast"})
      conn = post conn, api_asciicast_path(conn, :create), %{"asciicast" => upload}
      assert text_response(conn, 201) =~ @asciicast_url
      assert List.first(get_resp_header(conn, "location")) =~ @asciicast_url
    end


                                                          content_type: "application/octet-stream"})}

      conn = post conn, api_asciicast_path(conn, :create), %{"asciicast" => asciicast}
      assert text_response(conn, 201) =~ @successful_response
      assert List.first(get_resp_header(conn, "location")) =~ @asciicast_url
    end

