From f532c63340153d9a0cbcba7f1d00e01691dbc68f Mon Sep 17 00:00:00 2001 From: Milton Mazzarri Date: Tue, 19 Mar 2019 23:07:07 -0500 Subject: [PATCH] Add more tests for Hunter.Notification --- test/hunter/notification_test.exs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/hunter/notification_test.exs b/test/hunter/notification_test.exs index d17030b..59ed398 100644 --- a/test/hunter/notification_test.exs +++ b/test/hunter/notification_test.exs @@ -28,4 +28,20 @@ defmodule Hunter.NotificationTest do assert "paperswelove" == notification.account.username assert "follow" == notification.type end + + test "deletes all notifications from Mastodon server" do + expect(Hunter.ApiMock, :clear_notifications, fn _conn -> + true + end) + + assert Notification.clear_notifications(@conn) + end + + test "dismiss a single notification" do + expect(Hunter.ApiMock, :clear_notification, fn _conn, _id -> + true + end) + + assert Notification.clear_notification(@conn, 17_476) + end end