From 9ff61ed793b7fd968b51c5f6e4b72958adeae977 Mon Sep 17 00:00:00 2001
From: raeno <just.raeno@gmail.com>
Date: Fri, 14 Dec 2018 20:23:51 +0100
Subject: [PATCH] Fix tests

Notice test has been failing due to missing placeholder in index.html
I've tried to use fixtures to substitute that file in test environment but it became too much hassle. Fixtures are not copied to _build directory so I'd need to change file fetching logic. IMO it doesn't worth it since pleroma-fe already has this placeholder merged and all future updated of index.html will include it.
---
 priv/static/index.html                       | 2 +-
 test/web/ostatus/ostatus_controller_test.exs | 6 ++----
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/priv/static/index.html b/priv/static/index.html
index 0a2a56035..4ae1afc82 100644
--- a/priv/static/index.html
+++ b/priv/static/index.html
@@ -1 +1 @@
-<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>Pleroma</title><link rel=icon type=image/png href=/favicon.png><link rel=stylesheet href=/static/font/css/fontello.css><link rel=stylesheet href=/static/font/css/animation.css><link href=/static/css/app.ef3dfe574a06c79d5c5ca88943ef4673.css rel=stylesheet></head><body style="display: none"><div id=app></div><script type=text/javascript src=/static/js/manifest.f60b0c5412942809e9e3.js></script><script type=text/javascript src=/static/js/vendor.3be52ab73ddf60b35112.js></script><script type=text/javascript src=/static/js/app.c10f63ec367fc4f92eea.js></script></body></html>
\ No newline at end of file
+<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>Pleroma</title><!--server-generated-meta--><link rel=icon type=image/png href=/favicon.png><link rel=stylesheet href=/static/font/css/fontello.css><link rel=stylesheet href=/static/font/css/animation.css><link href=/static/css/app.ef3dfe574a06c79d5c5ca88943ef4673.css rel=stylesheet></head><body style="display: none"><div id=app></div><script type=text/javascript src=/static/js/manifest.f60b0c5412942809e9e3.js></script><script type=text/javascript src=/static/js/vendor.3be52ab73ddf60b35112.js></script><script type=text/javascript src=/static/js/app.c10f63ec367fc4f92eea.js></script></body></html>
\ No newline at end of file
diff --git a/test/web/ostatus/ostatus_controller_test.exs b/test/web/ostatus/ostatus_controller_test.exs
index 747e30154..e9e9bdb16 100644
--- a/test/web/ostatus/ostatus_controller_test.exs
+++ b/test/web/ostatus/ostatus_controller_test.exs
@@ -136,17 +136,15 @@ defmodule Pleroma.Web.OStatus.OStatusControllerTest do
     |> response(404)
   end
 
-  test "renders notice metatags in html format" do
+  test "renders notice metatags in html format", %{conn: conn} do
     note_activity = insert(:note_activity)
-
     conn = get(conn, "/notice/#{note_activity.id}")
-
+    body = html_response(conn, 200)
     twitter_card_summary = "<meta content=\"summary\" property=\"twitter:card\">"
 
     description_content =
       "<meta content=\"#{note_activity.data["object"]["content"]}\" property=\"og:description\">"
 
-    body = html_response(conn, 200)
     assert body =~ twitter_card_summary
     assert body =~ description_content
   end