Add test for Notifications

master
Milton Mazzarri 2017-04-16 22:40:46 -05:00
parent 9db65d28bd
commit 49e56fe52d
No known key found for this signature in database
GPG Key ID: 9F4193F2B5A558FE
1 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,21 @@
defmodule Hunter.NotificationTest do
use ExUnit.Case, async: true
alias Hunter.Notification
setup do
[conn: Hunter.Client.new([base_url: "https://example.com", bearer_token: "123456"])]
end
test "fetch user's notifications", %{conn: conn} do
notifications = conn |> Notification.notifications() |> List.first()
assert "paperswelove" == notifications.account["username"]
assert "follow" == notifications.type
end
test "fetch a single notification", %{conn: conn} do
notification = Notification.notification(conn, 17476)
assert "paperswelove" == notification.account["username"]
assert "follow" == notification.type
end
end