Don't use twitterAPI for subscription tests
authorSadposter <hannah+pleroma@coffee-and-dreams.uk>
Fri, 5 Apr 2019 16:00:41 +0000 (17:00 +0100)
committerHannah Ward <Hannah.ward9001@gmail.com>
Fri, 5 Apr 2019 16:02:09 +0000 (17:02 +0100)
test/notification_test.exs

index 96a8d372ad3574bf75c9cd50bc259aaddb7c24c6..2163c95c0a07e6519c6890619d8da00c2dfcf95c 100644 (file)
@@ -33,8 +33,9 @@ defmodule Pleroma.NotificationTest do
     test "it creates a notification for subscribed users" do
       user = insert(:user)
       subscriber = insert(:user)
+  
+      User.subscribe(subscriber, user)
 
-      {:ok, _, _} = TwitterAPI.subscribe(subscriber, %{"user_id" => user.id})
       {:ok, status} = TwitterAPI.create_status(user, %{"status" => "Akariiiin"})
       {:ok, [notification]} = Notification.create_notifications(status)
 
@@ -101,7 +102,7 @@ defmodule Pleroma.NotificationTest do
       subscriber = insert(:user)
 
       {:ok, _, _, _} = TwitterAPI.follow(subscriber, %{"user_id" => user.id})
-      {:ok, _, _} = TwitterAPI.subscribe(subscriber, %{"user_id" => user.id})
+      User.subscribe(subscriber, user)
       {:ok, status} = TwitterAPI.create_status(user, %{"status" => "Akariiiin"})
       {:ok, [_notif]} = Notification.create_notifications(status)
     end