add missing prismo testcase data
authorWilliam Pitcock <nenolod@dereferenced.org>
Sat, 10 Nov 2018 11:06:29 +0000 (11:06 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Sat, 10 Nov 2018 11:11:01 +0000 (11:11 +0000)
test/fixtures/httpoison_mock/https___prismo.news__mxb.json [new file with mode: 0644]
test/fixtures/prismo-url-map.json
test/support/httpoison_mock.ex

diff --git a/test/fixtures/httpoison_mock/https___prismo.news__mxb.json b/test/fixtures/httpoison_mock/https___prismo.news__mxb.json
new file mode 100644 (file)
index 0000000..a2fe531
--- /dev/null
@@ -0,0 +1 @@
+{"id":"https://prismo.news/@mxb","type":"Person","name":"mxb","preferredUsername":"mxb","summary":"Creator of △ Prismo\r\n\r\nFollow me at @mb@mstdn.io","inbox":"https://prismo.news/ap/accounts/mxb/inbox","outbox":"https://prismo.news/ap/accounts/mxb/outbox","url":"https://prismo.news/@mxb","publicKey":{"id":"https://prismo.news/@mxb#main-key","owner":"https://prismo.news/@mxb","publicKeyPem":"-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA41gqLkBYuPLurC2TarF8\nbdyvqP54XzKyScJ6iPNkk4D4plYdWUVj0aOIHQ8LVfBeziH83jDMpRegm1sRLpNG\n1Ti+SzlWyTwugJ8wfQvwJL7iEzqhuPFddjPLpv0djMptvm5vtG6u6O3g4RpX12bv\n4pYRoMStPSv9KRKD/8Naw5Nv85PIWRc9rOly/EoVZBnbesroo69caiGthgChE2pa\niisQ5CEgj/615WUlUATkz3VdExKQkQOdeVABheIvcS5OsMurXnpWyLQ4n9WalNvF\nlJc08aOTIo4plsLAvdcGRDsBzio4qPok3jgzPpFkDqe+02WG/QMPT9VrzKO49N5R\nqQIDAQAB\n-----END PUBLIC KEY-----\n"},"icon":{"type":"Image","url":"https://prismo.s3.wasabisys.com/account/1/avatar/size_400-b6e570850878684362ba3b4bd9ceb007.jpg","media_type":null},"@context":["https://www.w3.org/ns/activitystreams","https://w3id.org/security/v1",{"Hashtag":"as:Hashtag"},{"votes":{"@id":"as:votes","@type":"@id"}}]}
\ No newline at end of file
index 9088d01af71f106d88f7d75e87795d6f4ec7b6e2..4e2e2fd4a4a0662cfd45ccc65e46c9fa71a9a9ac 100644 (file)
@@ -1,52 +1,65 @@
 {
-  "id": "https://prismo.news/posts/83",
-  "type": "Article",
-  "name": "Introducing: Federated follows!",
-  "published": "2018-11-01T07:10:05Z",
-  "content": "We are more than thrilled to announce that Prismo now supports federated follows! It means you ca...",
-  "url": {
-    "type": "Link",
-    "mimeType": "text/html",
-    "href": "https://prismo.news/posts/83"
-  },
-  "votes": 12,
-  "attributedTo": [
-    {
-      "type": "Person",
-      "id": "https://prismo.news/@mxb"
+    "id": "https://prismo.news/posts/83#Create",
+    "type": "Create",
+    "actor": [
+        {
+            "type": "Person",
+            "id": "https://prismo.news/@mxb"
+        }
+    ],
+    "to": [
+        "https://www.w3.org/ns/activitystreams#Public"
+    ],
+    "object": {
+        "id": "https://prismo.news/posts/83",
+        "type": "Article",
+        "name": "Introducing: Federated follows!",
+        "published": "2018-11-01T07:10:05Z",
+        "content": "We are more than thrilled to announce that Prismo now supports federated follows! It means you ca...",
+        "url": {
+            "type": "Link",
+            "mimeType": "text/html",
+            "href": "https://prismo.news/posts/83"
+        },
+        "votes": 12,
+        "attributedTo": [
+            {
+                "type": "Person",
+                "id": "https://prismo.news/@mxb"
+            }
+        ],
+        "to": [
+            "https://www.w3.org/ns/activitystreams#Public"
+        ],
+        "tags": [
+            {
+                "type": "Hashtag",
+                "href": "https://prismo.news/tags/prismo",
+                "name": "#prismo"
+            },
+            {
+                "type": "Hashtag",
+                "href": "https://prismo.news/tags/prismodev",
+                "name": "#prismodev"
+            },
+            {
+                "type": "Hashtag",
+                "href": "https://prismo.news/tags/meta",
+                "name": "#meta"
+            }
+        ],
+        "@context": [
+            "https://www.w3.org/ns/activitystreams",
+            "https://w3id.org/security/v1",
+            {
+                "Hashtag": "as:Hashtag"
+            },
+            {
+                "votes": {
+                    "@id": "as:votes",
+                    "@type": "@id"
+                }
+            }
+        ]
     }
-  ],
-  "to": [
-    "https://www.w3.org/ns/activitystreams#Public"
-  ],
-  "tags": [
-    {
-      "type": "Hashtag",
-      "href": "https://prismo.news/tags/prismo",
-      "name": "#prismo"
-    },
-    {
-      "type": "Hashtag",
-      "href": "https://prismo.news/tags/prismodev",
-      "name": "#prismodev"
-    },
-    {
-      "type": "Hashtag",
-      "href": "https://prismo.news/tags/meta",
-      "name": "#meta"
-    }
-  ],
-  "@context": [
-    "https://www.w3.org/ns/activitystreams",
-    "https://w3id.org/security/v1",
-    {
-      "Hashtag": "as:Hashtag"
-    },
-    {
-      "votes": {
-        "@id": "as:votes",
-        "@type": "@id"
-      }
-    }
-  ]
 }
index 75c78d70eb9bab1df201ce6bd270e5942d22dee7..ab964334da72f67e07005e3993af9a7abacb7b59 100644 (file)
@@ -3,6 +3,14 @@ defmodule HTTPoisonMock do
 
   def get(url, body \\ [], headers \\ [])
 
+  def get("https://prismo.news/@mxb", _, _) do
+    {:ok,
+     %Response{
+       status_code: 200,
+       body: File.read!("test/fixtures/httpoison_mock/https___prismo.news__mxb.json")
+     }}
+  end
+
   def get("https://osada.macgirvin.com/channel/mike", _, _) do
     {:ok,
      %Response{