@ -30,6 +30,8 @@ func TestAPINotification(t *testing.T) {
session := loginUser ( t , user2 . Name )
session := loginUser ( t , user2 . Name )
token := getTokenForLoggedInUser ( t , session , auth_model . AccessTokenScopeWriteNotification , auth_model . AccessTokenScopeWriteRepository )
token := getTokenForLoggedInUser ( t , session , auth_model . AccessTokenScopeWriteNotification , auth_model . AccessTokenScopeWriteRepository )
MakeRequest ( t , NewRequest ( t , "GET" , "/api/v1/notifications" ) , http . StatusUnauthorized )
// -- GET /notifications --
// -- GET /notifications --
// test filter
// test filter
since := "2000-01-01T00%3A50%3A01%2B00%3A00" // 946687801
since := "2000-01-01T00%3A50%3A01%2B00%3A00" // 946687801
@ -80,6 +82,8 @@ func TestAPINotification(t *testing.T) {
assert . False ( t , apiNL [ 1 ] . Unread )
assert . False ( t , apiNL [ 1 ] . Unread )
assert . True ( t , apiNL [ 1 ] . Pinned )
assert . True ( t , apiNL [ 1 ] . Pinned )
MakeRequest ( t , NewRequest ( t , "GET" , fmt . Sprintf ( "/api/v1/notifications/threads/%d" , 1 ) ) , http . StatusUnauthorized )
// -- GET /notifications/threads/{id} --
// -- GET /notifications/threads/{id} --
// get forbidden
// get forbidden
req = NewRequest ( t , "GET" , fmt . Sprintf ( "/api/v1/notifications/threads/%d?token=%s" , 1 , token ) )
req = NewRequest ( t , "GET" , fmt . Sprintf ( "/api/v1/notifications/threads/%d?token=%s" , 1 , token ) )
@ -99,6 +103,8 @@ func TestAPINotification(t *testing.T) {
assert . EqualValues ( t , thread5 . Issue . APIURL ( ) , apiN . Subject . URL )
assert . EqualValues ( t , thread5 . Issue . APIURL ( ) , apiN . Subject . URL )
assert . EqualValues ( t , thread5 . Repository . HTMLURL ( ) , apiN . Repository . HTMLURL )
assert . EqualValues ( t , thread5 . Repository . HTMLURL ( ) , apiN . Repository . HTMLURL )
MakeRequest ( t , NewRequest ( t , "GET" , "/api/v1/notifications/new" ) , http . StatusUnauthorized )
new := struct {
new := struct {
New int64 ` json:"new" `
New int64 ` json:"new" `
} { }
} { }