@@ -32,7 +32,7 @@ func TestActivityService_ListWatchers(t *testing.T) {
32
32
}
33
33
}
34
34
35
- func TestActivityService_ListWatchedRepositories_authenticatedUser (t * testing.T ) {
35
+ func TestActivityService_ListWatched_authenticatedUser (t * testing.T ) {
36
36
setup ()
37
37
defer teardown ()
38
38
@@ -41,18 +41,18 @@ func TestActivityService_ListWatchedRepositories_authenticatedUser(t *testing.T)
41
41
fmt .Fprint (w , `[{"id":1}]` )
42
42
})
43
43
44
- watched , _ , err := client .Activity .ListWatchedRepositories ("" )
44
+ watched , _ , err := client .Activity .ListWatched ("" )
45
45
if err != nil {
46
- t .Errorf ("Activity.ListWatchedRepositories returned error: %v" , err )
46
+ t .Errorf ("Activity.ListWatched returned error: %v" , err )
47
47
}
48
48
49
49
want := []Repository {{ID : Int (1 )}}
50
50
if ! reflect .DeepEqual (watched , want ) {
51
- t .Errorf ("Activity.ListWatchedRepositories returned %+v, want %+v" , watched , want )
51
+ t .Errorf ("Activity.ListWatched returned %+v, want %+v" , watched , want )
52
52
}
53
53
}
54
54
55
- func TestActivityService_ListWatchedRepositories_specifiedUser (t * testing.T ) {
55
+ func TestActivityService_ListWatched_specifiedUser (t * testing.T ) {
56
56
setup ()
57
57
defer teardown ()
58
58
@@ -61,18 +61,18 @@ func TestActivityService_ListWatchedRepositories_specifiedUser(t *testing.T) {
61
61
fmt .Fprint (w , `[{"id":1}]` )
62
62
})
63
63
64
- watched , _ , err := client .Activity .ListWatchedRepositories ("u" )
64
+ watched , _ , err := client .Activity .ListWatched ("u" )
65
65
if err != nil {
66
- t .Errorf ("Activity.ListWatchedRepositories returned error: %v" , err )
66
+ t .Errorf ("Activity.ListWatched returned error: %v" , err )
67
67
}
68
68
69
69
want := []Repository {{ID : Int (1 )}}
70
70
if ! reflect .DeepEqual (watched , want ) {
71
- t .Errorf ("Activity.ListWatchedRepositories returned %+v, want %+v" , watched , want )
71
+ t .Errorf ("Activity.ListWatched returned %+v, want %+v" , watched , want )
72
72
}
73
73
}
74
74
75
- func TestActivityService_GetRepositorySubscription_true (t * testing.T ) {
75
+ func TestActivityService_GetSubscription_true (t * testing.T ) {
76
76
setup ()
77
77
defer teardown ()
78
78
@@ -81,18 +81,18 @@ func TestActivityService_GetRepositorySubscription_true(t *testing.T) {
81
81
fmt .Fprint (w , `{"subscribed":true}` )
82
82
})
83
83
84
- sub , _ , err := client .Activity .GetRepositorySubscription ("o" , "r" )
84
+ sub , _ , err := client .Activity .GetSubscription ("o" , "r" )
85
85
if err != nil {
86
- t .Errorf ("Activity.GetRepositorySubscription returned error: %v" , err )
86
+ t .Errorf ("Activity.GetSubscription returned error: %v" , err )
87
87
}
88
88
89
- want := & RepositorySubscription {Subscribed : Bool (true )}
89
+ want := & Subscription {Subscribed : Bool (true )}
90
90
if ! reflect .DeepEqual (sub , want ) {
91
- t .Errorf ("Activity.GetRepositorySubscription returned %+v, want %+v" , sub , want )
91
+ t .Errorf ("Activity.GetSubscription returned %+v, want %+v" , sub , want )
92
92
}
93
93
}
94
94
95
- func TestActivityService_GetRepositorySubscription_false (t * testing.T ) {
95
+ func TestActivityService_GetSubscription_false (t * testing.T ) {
96
96
setup ()
97
97
defer teardown ()
98
98
@@ -101,18 +101,18 @@ func TestActivityService_GetRepositorySubscription_false(t *testing.T) {
101
101
w .WriteHeader (http .StatusNotFound )
102
102
})
103
103
104
- sub , _ , err := client .Activity .GetRepositorySubscription ("o" , "r" )
104
+ sub , _ , err := client .Activity .GetSubscription ("o" , "r" )
105
105
if err != nil {
106
- t .Errorf ("Activity.GetRepositorySubscription returned error: %v" , err )
106
+ t .Errorf ("Activity.GetSubscription returned error: %v" , err )
107
107
}
108
108
109
- var want * RepositorySubscription
109
+ var want * Subscription
110
110
if ! reflect .DeepEqual (sub , want ) {
111
- t .Errorf ("Activity.GetRepositorySubscription returned %+v, want %+v" , sub , want )
111
+ t .Errorf ("Activity.GetSubscription returned %+v, want %+v" , sub , want )
112
112
}
113
113
}
114
114
115
- func TestActivityService_GetRepositorySubscription_error (t * testing.T ) {
115
+ func TestActivityService_GetSubscription_error (t * testing.T ) {
116
116
setup ()
117
117
defer teardown ()
118
118
@@ -121,20 +121,20 @@ func TestActivityService_GetRepositorySubscription_error(t *testing.T) {
121
121
w .WriteHeader (http .StatusBadRequest )
122
122
})
123
123
124
- _ , _ , err := client .Activity .GetRepositorySubscription ("o" , "r" )
124
+ _ , _ , err := client .Activity .GetSubscription ("o" , "r" )
125
125
if err == nil {
126
126
t .Errorf ("Expected HTTP 400 response" )
127
127
}
128
128
}
129
129
130
- func TestActivityService_SetRepositorySubscription (t * testing.T ) {
130
+ func TestActivityService_SetSubscription (t * testing.T ) {
131
131
setup ()
132
132
defer teardown ()
133
133
134
- input := & RepositorySubscription {Subscribed : Bool (true )}
134
+ input := & Subscription {Subscribed : Bool (true )}
135
135
136
136
mux .HandleFunc ("/repos/o/r/subscription" , func (w http.ResponseWriter , r * http.Request ) {
137
- v := new (RepositorySubscription )
137
+ v := new (Subscription )
138
138
json .NewDecoder (r .Body ).Decode (v )
139
139
140
140
testMethod (t , r , "PUT" )
@@ -145,27 +145,27 @@ func TestActivityService_SetRepositorySubscription(t *testing.T) {
145
145
fmt .Fprint (w , `{"ignored":true}` )
146
146
})
147
147
148
- sub , _ , err := client .Activity .SetRepositorySubscription ("o" , "r" , input )
148
+ sub , _ , err := client .Activity .SetSubscription ("o" , "r" , input )
149
149
if err != nil {
150
- t .Errorf ("Activity.SetRepositorySubscription returned error: %v" , err )
150
+ t .Errorf ("Activity.SetSubscription returned error: %v" , err )
151
151
}
152
152
153
- want := & RepositorySubscription {Ignored : Bool (true )}
153
+ want := & Subscription {Ignored : Bool (true )}
154
154
if ! reflect .DeepEqual (sub , want ) {
155
- t .Errorf ("Activity.SetRepositorySubscription returned %+v, want %+v" , sub , want )
155
+ t .Errorf ("Activity.SetSubscription returned %+v, want %+v" , sub , want )
156
156
}
157
157
}
158
158
159
- func TestActivityService_DeleteRepositorySubscription (t * testing.T ) {
159
+ func TestActivityService_DeleteSubscription (t * testing.T ) {
160
160
setup ()
161
161
defer teardown ()
162
162
163
163
mux .HandleFunc ("/repos/o/r/subscription" , func (w http.ResponseWriter , r * http.Request ) {
164
164
testMethod (t , r , "DELETE" )
165
165
})
166
166
167
- _ , err := client .Activity .DeleteRepositorySubscription ("o" , "r" )
167
+ _ , err := client .Activity .DeleteSubscription ("o" , "r" )
168
168
if err != nil {
169
- t .Errorf ("Activity.DeleteRepositorySubscription returned error: %v" , err )
169
+ t .Errorf ("Activity.DeleteSubscription returned error: %v" , err )
170
170
}
171
171
}
0 commit comments