Fix tests
authorraeno <just.raeno@gmail.com>
Fri, 14 Dec 2018 19:23:51 +0000 (20:23 +0100)
committerraeno <just.raeno@gmail.com>
Fri, 14 Dec 2018 19:23:51 +0000 (20:23 +0100)
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
test/web/ostatus/ostatus_controller_test.exs

index 0a2a560350f10bfe09b86907edad362bd7153276..4ae1afc82a325df10bb7df7cd73db3299184ad36 100644 (file)
@@ -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
index 747e3015401a24bae1a18ce8a3b83652af8081c2..e9e9bdb169b12064fe4727be67775ba9271d3305 100644 (file)
@@ -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