@@ -32,7 +32,7 @@ func TestAuthWithGithubToken(t *testing.T) {
3232
3333 client .Enable (1 )
3434
35- // Assert expected calls we made to Zappr
35+ // Assert expected calls were made to Zappr
3636 zapprMock .AssertExpectations (t )
3737}
3838
@@ -58,7 +58,7 @@ func TestAuthWithZapprToken(t *testing.T) {
5858
5959 client .Enable (1 )
6060
61- // Assert expected calls we made to Zappr
61+ // Assert expected calls were made to Zappr
6262 zapprMock .AssertExpectations (t )
6363}
6464
@@ -94,7 +94,7 @@ func TestArbitraryErrorWithJSONErrorBodyFromZappr(t *testing.T) {
9494 // Assert error detail retured by zappr is in returned error
9595 assert .True (t , errwrap .Contains (err , "Strange error message" ), err )
9696
97- // Assert expected calls we made to Zappr
97+ // Assert expected calls were made to Zappr
9898 zapprMock .AssertExpectations (t )
9999}
100100
@@ -122,7 +122,7 @@ func TestArbitraryErrorWithNonJSONErrorBodyFromZappr(t *testing.T) {
122122 // Assert "unknown zappr" error was returned
123123 assert .True (t , errwrap .Contains (err , ErrZapprServerError .Error ()))
124124
125- // Assert expected calls we made to Zappr
125+ // Assert expected calls were made to Zappr
126126 zapprMock .AssertExpectations (t )
127127}
128128
@@ -149,7 +149,7 @@ func TestEnable(t *testing.T) {
149149 // Assert no errors were received
150150 assert .Nil (t , err )
151151
152- // Assert expected calls we made to Zappr
152+ // Assert expected calls were made to Zappr
153153 zapprMock .AssertExpectations (t )
154154}
155155
@@ -182,7 +182,7 @@ func TestEnable_AlreadyExist(t *testing.T) {
182182 // Assert "already enabled" error was returned
183183 assert .Equal (t , ErrZapprAlreadyEnabled , err )
184184
185- // Assert expected calls we made to Zappr
185+ // Assert expected calls were made to Zappr
186186 zapprMock .AssertExpectations (t )
187187}
188188
@@ -209,7 +209,7 @@ func TestDisable(t *testing.T) {
209209 // Assert no errors were received
210210 assert .Nil (t , err )
211211
212- // Assert expected calls we made to Zappr
212+ // Assert expected calls were made to Zappr
213213 zapprMock .AssertExpectations (t )
214214}
215215
@@ -242,7 +242,7 @@ func TestDisable_RepoDeletedFromGithub(t *testing.T) {
242242 // Assert "already not enabled" error was returned
243243 assert .Equal (t , ErrZapprAlreadyNotEnabled , err )
244244
245- // Assert expected calls we made to Zappr
245+ // Assert expected calls were made to Zappr
246246 zapprMock .AssertExpectations (t )
247247}
248248
@@ -275,6 +275,23 @@ func TestDisable_RepoDeletedFromGithub_AndNotOnZappr(t *testing.T) {
275275 // Assert "already not enabled" error was returned
276276 assert .Equal (t , ErrZapprAlreadyNotEnabled , err )
277277
278- // Assert expected calls we made to Zappr
278+ // Assert expected calls were made to Zappr
279+ zapprMock .AssertExpectations (t )
280+ }
281+
282+ func TestProblematicRequest (t * testing.T ) {
283+ // Get the Zappr Client, Mock Handler and Test Server
284+ client , zapprMock , testServer := NewMockAndHandlerNilResponse ()
285+
286+ // Start the test server and stop it when done
287+ testServer .Start ()
288+ defer testServer .Close ()
289+
290+ err := client .Enable (1 )
291+
292+ // Assert "unknown zappr" error was returned
293+ assert .True (t , errwrap .Contains (err , ErrZapprServerError .Error ()))
294+
295+ // Assert expected calls were made to Zappr
279296 zapprMock .AssertExpectations (t )
280297}
0 commit comments