Skip to content

Commit

Permalink
Merge pull request #18 from KaanSK/master
Browse files Browse the repository at this point in the history
Incorrect assert.Equal inputs fixed
  • Loading branch information
Massad authored Feb 11, 2022
2 parents 0a511c4 + 9fdb48c commit a83b2f4
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions tests/article_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build all
// +build all

package tests
Expand Down Expand Up @@ -131,7 +132,7 @@ func TestRegister(t *testing.T) {
resp := httptest.NewRecorder()

testRouter.ServeHTTP(resp, req)
assert.Equal(t, resp.Code, http.StatusOK)
assert.Equal(t, http.StatusOK, resp.Code)
}

/**
Expand Down Expand Up @@ -161,7 +162,7 @@ func TestRegisterInvalidEmail(t *testing.T) {
resp := httptest.NewRecorder()

testRouter.ServeHTTP(resp, req)
assert.Equal(t, resp.Code, http.StatusNotAcceptable)
assert.Equal(t, http.StatusNotAcceptable, resp.Code)
}

/**
Expand Down Expand Up @@ -216,7 +217,7 @@ func TestLogin(t *testing.T) {
accessToken = res.Token.AccessToken
refreshToken = res.Token.RefreshToken

assert.Equal(t, resp.Code, http.StatusOK)
assert.Equal(t, http.StatusOK, resp.Code)
}

/**
Expand Down Expand Up @@ -246,7 +247,7 @@ func TestInvalidLogin(t *testing.T) {

testRouter.ServeHTTP(resp, req)

assert.Equal(t, resp.Code, http.StatusNotAcceptable)
assert.Equal(t, http.StatusNotAcceptable, resp.Code)
}

/**
Expand Down Expand Up @@ -289,7 +290,7 @@ func TestCreateArticle(t *testing.T) {

articleID = res.ID

assert.Equal(t, resp.Code, http.StatusOK)
assert.Equal(t, http.StatusOK, resp.Code)
}

/**
Expand Down Expand Up @@ -318,7 +319,7 @@ func TestCreateInvalidArticle(t *testing.T) {
resp := httptest.NewRecorder()
testRouter.ServeHTTP(resp, req)

assert.Equal(t, resp.Code, http.StatusNotAcceptable)
assert.Equal(t, http.StatusNotAcceptable, resp.Code)
}

/**
Expand All @@ -340,7 +341,7 @@ func TestGetArticle(t *testing.T) {
resp := httptest.NewRecorder()
testRouter.ServeHTTP(resp, req)

assert.Equal(t, resp.Code, http.StatusOK)
assert.Equal(t, http.StatusOK, resp.Code)
}

/**
Expand All @@ -362,7 +363,7 @@ func TestGetInvalidArticle(t *testing.T) {
resp := httptest.NewRecorder()
testRouter.ServeHTTP(resp, req)

assert.Equal(t, resp.Code, http.StatusNotFound)
assert.Equal(t, http.StatusNotFound, resp.Code)
}

/**
Expand All @@ -384,7 +385,7 @@ func TestGetArticleNotLoggedin(t *testing.T) {
resp := httptest.NewRecorder()
testRouter.ServeHTTP(resp, req)

assert.Equal(t, resp.Code, http.StatusUnauthorized)
assert.Equal(t, http.StatusUnauthorized, resp.Code)
}

/**
Expand All @@ -407,7 +408,7 @@ func TestGetArticleUnauthorized(t *testing.T) {
resp := httptest.NewRecorder()
testRouter.ServeHTTP(resp, req)

assert.Equal(t, resp.Code, http.StatusUnauthorized)
assert.Equal(t, http.StatusUnauthorized, resp.Code)
}

/**
Expand Down Expand Up @@ -439,7 +440,7 @@ func TestUpdateArticle(t *testing.T) {
resp := httptest.NewRecorder()
testRouter.ServeHTTP(resp, req)

assert.Equal(t, resp.Code, http.StatusOK)
assert.Equal(t, http.StatusOK, resp.Code)
}

/**
Expand All @@ -463,7 +464,7 @@ func TestDeleteArticle(t *testing.T) {
resp := httptest.NewRecorder()
testRouter.ServeHTTP(resp, req)

assert.Equal(t, resp.Code, http.StatusOK)
assert.Equal(t, http.StatusOK, resp.Code)
}

/**
Expand Down Expand Up @@ -491,7 +492,7 @@ func TestRefreshToken(t *testing.T) {
resp := httptest.NewRecorder()
testRouter.ServeHTTP(resp, req)

assert.Equal(t, resp.Code, http.StatusOK)
assert.Equal(t, http.StatusOK, resp.Code)
}

/**
Expand Down Expand Up @@ -520,7 +521,7 @@ func TestInvalidRefreshToken(t *testing.T) {
resp := httptest.NewRecorder()
testRouter.ServeHTTP(resp, req)

assert.Equal(t, resp.Code, http.StatusUnauthorized)
assert.Equal(t, http.StatusUnauthorized, resp.Code)
}

/**
Expand All @@ -542,7 +543,7 @@ func TestUserLogout(t *testing.T) {
resp := httptest.NewRecorder()
testRouter.ServeHTTP(resp, req)

assert.Equal(t, resp.Code, http.StatusOK)
assert.Equal(t, http.StatusOK, resp.Code)
}

/**
Expand Down

0 comments on commit a83b2f4

Please sign in to comment.