@@ -23,8 +23,24 @@ func TestAPIWatch(t *testing.T) {
2323
2424 session := loginUser (t , user )
2525 token := getTokenForLoggedInUser (t , session , auth_model .AccessTokenScopeReadUser )
26+ tokenWithReadRepoScope := getTokenForLoggedInUser (t , session , auth_model .AccessTokenScopeReadRepository )
2627 tokenWithRepoScope := getTokenForLoggedInUser (t , session , auth_model .AccessTokenScopeWriteRepository , auth_model .AccessTokenScopeReadUser )
2728
29+ t .Run ("RepoSubscriptionUnauth" , func (t * testing.T ) {
30+ defer tests .PrintCurrentTest (t )()
31+
32+ req := NewRequest (t , "GET" , fmt .Sprintf ("/api/v1/repos/%s/subscription" , repo ))
33+ MakeRequest (t , req , http .StatusUnauthorized )
34+ })
35+
36+ t .Run ("RepoSubscriptions" , func (t * testing.T ) {
37+ defer tests .PrintCurrentTest (t )()
38+
39+ req := NewRequest (t , "GET" , fmt .Sprintf ("/api/v1/repos/%s/subscription" , repo )).
40+ AddTokenAuth (tokenWithReadRepoScope )
41+ MakeRequest (t , req , http .StatusOK )
42+ })
43+
2844 t .Run ("Watch" , func (t * testing.T ) {
2945 defer tests .PrintCurrentTest (t )()
3046
0 commit comments