diff options
author | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2019-01-14 00:05:45 +0100 |
---|---|---|
committer | William Pitcock <nenolod@dereferenced.org> | 2019-01-26 14:18:23 +0000 |
commit | d9f3af477d687fb8cb469ec652586911ad51d0b0 (patch) | |
tree | 8134316f828f472ac3cee7397986f3469b65c78d /test/web/rich_media | |
parent | c00fba4f7dcf10c49bf1fa03be348e7c99a3fc47 (diff) | |
download | pleroma-d9f3af477d687fb8cb469ec652586911ad51d0b0.tar.gz pleroma-d9f3af477d687fb8cb469ec652586911ad51d0b0.zip |
Move definitions of RichMedia fixtures to test/support/http_request_mock.ex
Diffstat (limited to 'test/web/rich_media')
-rw-r--r-- | test/web/rich_media/controllers/rich_media_controller_test.exs | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/test/web/rich_media/controllers/rich_media_controller_test.exs b/test/web/rich_media/controllers/rich_media_controller_test.exs index 37c82631f..fef126513 100644 --- a/test/web/rich_media/controllers/rich_media_controller_test.exs +++ b/test/web/rich_media/controllers/rich_media_controller_test.exs @@ -1,19 +1,14 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/> +# SPDX-License-Identifier: AGPL-3.0-only + defmodule Pleroma.Web.RichMedia.RichMediaControllerTest do use Pleroma.Web.ConnCase import Pleroma.Factory + import Tesla.Mock setup do - Tesla.Mock.mock(fn - %{ - method: :get, - url: "http://example.com/ogp" - } -> - %Tesla.Env{status: 200, body: File.read!("test/fixtures/rich_media/ogp.html")} - - %{method: :get, url: "http://example.com/empty"} -> - %Tesla.Env{status: 200, body: "hello"} - end) - + mock(fn env -> apply(HttpRequestMock, :request, [env]) end) :ok end |