diff options
author | Roger Braun <roger@rogerbraun.net> | 2018-02-11 17:19:06 +0100 |
---|---|---|
committer | Roger Braun <roger@rogerbraun.net> | 2018-02-11 17:19:06 +0100 |
commit | c1d26751e6cd5fdfeb256e4b3ba81e1a7039894f (patch) | |
tree | d1b6ca8d758da6e2ac47985d65a2aef64991de73 | |
parent | 52200998c997576c9008cbe50b0a7b9f0e6134cc (diff) | |
download | pleroma-c1d26751e6cd5fdfeb256e4b3ba81e1a7039894f.tar.gz |
Mocks: Add mastodon user json example.
-rw-r--r-- | test/fixtures/httpoison_mock/admin@mastdon.example.org.json | 1 | ||||
-rw-r--r-- | test/support/httpoison_mock.ex | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/test/fixtures/httpoison_mock/admin@mastdon.example.org.json b/test/fixtures/httpoison_mock/admin@mastdon.example.org.json new file mode 100644 index 000000000..12aacdbbf --- /dev/null +++ b/test/fixtures/httpoison_mock/admin@mastdon.example.org.json @@ -0,0 +1 @@ +{"@context":["https://www.w3.org/ns/activitystreams","https://w3id.org/security/v1",{"manuallyApprovesFollowers":"as:manuallyApprovesFollowers","sensitive":"as:sensitive","movedTo":"as:movedTo","Hashtag":"as:Hashtag","ostatus":"http://ostatus.org#","atomUri":"ostatus:atomUri","inReplyToAtomUri":"ostatus:inReplyToAtomUri","conversation":"ostatus:conversation","toot":"http://joinmastodon.org/ns#","Emoji":"toot:Emoji"}],"id":"http://mastodon.example.org/users/admin","type":"Person","following":"http://mastodon.example.org/users/admin/following","followers":"http://mastodon.example.org/users/admin/followers","inbox":"http://mastodon.example.org/users/admin/inbox","outbox":"http://mastodon.example.org/users/admin/outbox","preferredUsername":"admin","name":"admin","summary":"\u003cp\u003e\u003c/p\u003e","url":"http://mastodon.example.org/@admin","manuallyApprovesFollowers":false,"publicKey":{"id":"http://mastodon.example.org/users/admin#main-key","owner":"http://mastodon.example.org/users/admin","publicKeyPem":"-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtc4Tir+3ADhSNF6VKrtW\nOU32T01w7V0yshmQei38YyiVwVvFu8XOP6ACchkdxbJ+C9mZud8qWaRJKVbFTMUG\nNX4+6Q+FobyuKrwN7CEwhDALZtaN2IPbaPd6uG1B7QhWorrY+yFa8f2TBM3BxnUy\nI4T+bMIZIEYG7KtljCBoQXuTQmGtuffO0UwJksidg2ffCF5Q+K//JfQagJ3UzrR+\nZXbKMJdAw4bCVJYs4Z5EhHYBwQWiXCyMGTd7BGlmMkY6Av7ZqHKC/owp3/0EWDNz\nNqF09Wcpr3y3e8nA10X40MJqp/wR+1xtxp+YGbq/Cj5hZGBG7etFOmIpVBrDOhry\nBwIDAQAB\n-----END PUBLIC KEY-----\n"},"endpoints":{"sharedInbox":"http://mastodon.example.org/inbox"}} diff --git a/test/support/httpoison_mock.ex b/test/support/httpoison_mock.ex index 21607ba95..7ac4885e9 100644 --- a/test/support/httpoison_mock.ex +++ b/test/support/httpoison_mock.ex @@ -366,6 +366,13 @@ defmodule HTTPoisonMock do }} end + def get("http://mastodon.example.org/users/admin", ["Accept": "application/activity+json"], _) do + {:ok, %Response{ + status_code: 200, + body: File.read!("test/fixtures/httpoison_mock/admin@mastdon.example.org.json") + }} + end + def get(url, body, headers) do {:error, "Not implemented the mock response for get #{inspect(url)}, #{inspect(body)}, #{inspect(headers)}"} end |