X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;ds=sidebyside;f=test%2Ftasks%2Ffrontend_test.exs;h=022ae51be1a7cb8864906889b26c5b39a782417e;hb=5c4ff5c73ce41f252e99a3c5c445efcecaa43dfe;hp=6a9a931eb5d36889a13c4507c1e13e3ee87603de;hpb=de00a4c0f1cc5d61d0a821a2d0a292f8bd95e3f1;p=akkoma diff --git a/test/tasks/frontend_test.exs b/test/tasks/frontend_test.exs index 6a9a931eb..022ae51be 100644 --- a/test/tasks/frontend_test.exs +++ b/test/tasks/frontend_test.exs @@ -24,13 +24,12 @@ defmodule Pleroma.FrontendTest do "pleroma" => %{ "ref" => "fantasy", "name" => "pleroma", - "build_url" => "http://gensokyo.2hu/builds/${ref}", - "build_dir" => "" + "build_url" => "http://gensokyo.2hu/builds/${ref}" } }) Tesla.Mock.mock(fn %{url: "http://gensokyo.2hu/builds/fantasy"} -> - %Tesla.Env{status: 200, body: File.read!("test/fixtures/tesla_mock/frontend.zip")} + %Tesla.Env{status: 200, body: File.read!("test/fixtures/tesla_mock/frontend_dist.zip")} end) capture_io(fn -> @@ -49,11 +48,18 @@ defmodule Pleroma.FrontendTest do } }) + folder = Path.join([@dir, "frontends", "pleroma", "fantasy"]) + previously_existing = Path.join([folder, "temp"]) + File.mkdir_p!(folder) + File.write!(previously_existing, "yey") + assert File.exists?(previously_existing) + capture_io(fn -> Frontend.run(["install", "pleroma", "--file", "test/fixtures/tesla_mock/frontend.zip"]) end) - assert File.exists?(Path.join([@dir, "frontends", "pleroma", "fantasy", "test.txt"])) + assert File.exists?(Path.join([folder, "test.txt"])) + refute File.exists?(previously_existing) end test "it downloads and unzips unknown frontends" do