Add more tests for Hunter.Notification

master
Milton Mazzarri 2019-03-19 23:07:07 -05:00
parent 3473d33566
commit f532c63340
No known key found for this signature in database
GPG Key ID: 9F4193F2B5A558FE
1 changed files with 16 additions and 0 deletions

View File

@ -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