Commit f6e131ee authored by Sadposter's avatar Sadposter Committed by Hannah Ward
Browse files

Don't use twitterAPI for subscription tests

parent 9ca91cbb
...@@ -33,8 +33,9 @@ test "notifies someone when they are directly addressed" do ...@@ -33,8 +33,9 @@ test "notifies someone when they are directly addressed" do
test "it creates a notification for subscribed users" do test "it creates a notification for subscribed users" do
user = insert(:user) user = insert(:user)
subscriber = 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, status} = TwitterAPI.create_status(user, %{"status" => "Akariiiin"})
{:ok, [notification]} = Notification.create_notifications(status) {:ok, [notification]} = Notification.create_notifications(status)
...@@ -101,7 +102,7 @@ test "it doesn't create duplicate notifications for follow+subscribed users" do ...@@ -101,7 +102,7 @@ test "it doesn't create duplicate notifications for follow+subscribed users" do
subscriber = insert(:user) subscriber = insert(:user)
{:ok, _, _, _} = TwitterAPI.follow(subscriber, %{"user_id" => user.id}) {: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, status} = TwitterAPI.create_status(user, %{"status" => "Akariiiin"})
{:ok, [_notif]} = Notification.create_notifications(status) {:ok, [_notif]} = Notification.create_notifications(status)
end end
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment