X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=test%2Fweb%2Ftwitter_api%2Ftwitter_api_test.exs;h=06c1ba6ec8ca71ced6a63163dbe64aa21eaa93e2;hb=d93789dfde3c44c76a56732088a897ddddfe9716;hp=af565c0e558340dee22b0adc46a1da321c9bb65d;hpb=802736679c62fb92000b53bb2901fe48d5998ed5;p=akkoma
diff --git a/test/web/twitter_api/twitter_api_test.exs b/test/web/twitter_api/twitter_api_test.exs
index af565c0e5..06c1ba6ec 100644
--- a/test/web/twitter_api/twitter_api_test.exs
+++ b/test/web/twitter_api/twitter_api_test.exs
@@ -35,7 +35,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do
{:ok, activity = %Activity{}} = TwitterAPI.create_status(user, input)
expected_text =
- "Hello again, @shp.<script></script>
This is on another :moominmamma: line. #2hu #epic #phantasmagoric
image.jpg"
+ "Hello again, @shp.<script></script>
This is on another :moominmamma: line. #2hu #epic #phantasmagoric
image.jpg"
assert get_in(activity.data, ["object", "content"]) == expected_text
assert get_in(activity.data, ["object", "type"]) == "Note"
@@ -166,7 +166,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do
test "Unblock another user using user_id" do
unblocked = insert(:user)
user = insert(:user)
- User.block(user, unblocked)
+ {:ok, user, _unblocked} = TwitterAPI.block(user, %{"user_id" => unblocked.id})
{:ok, user, _unblocked} = TwitterAPI.unblock(user, %{"user_id" => unblocked.id})
assert user.info["blocks"] == []
@@ -175,7 +175,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do
test "Unblock another user using screen_name" do
unblocked = insert(:user)
user = insert(:user)
- User.block(user, unblocked)
+ {:ok, user, _unblocked} = TwitterAPI.block(user, %{"screen_name" => unblocked.nickname})
{:ok, user, _unblocked} = TwitterAPI.unblock(user, %{"screen_name" => unblocked.nickname})
assert user.info["blocks"] == []
@@ -228,6 +228,17 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do
assert status == updated_activity
end
+ test "it unretweets an already retweeted status" do
+ user = insert(:user)
+ note_activity = insert(:note_activity)
+
+ {:ok, _status} = TwitterAPI.repeat(user, note_activity.id)
+ {:ok, status} = TwitterAPI.unrepeat(user, note_activity.id)
+ updated_activity = Activity.get_by_ap_id(note_activity.data["id"])
+
+ assert status == updated_activity
+ end
+
test "it registers a new user and returns the user." do
data = %{
"nickname" => "lain",