mirror of
https://github.com/pushbits/server.git
synced 2025-05-02 19:56:15 +02:00
Fix spelling using misspell
This commit is contained in:
parent
50a92b6d22
commit
5e640800fe
6 changed files with 16 additions and 16 deletions
|
@ -121,7 +121,7 @@ func (h *ApplicationHandler) updateApplication(ctx *gin.Context, a *model.Applic
|
||||||
// @Accept json,mpfd
|
// @Accept json,mpfd
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Param name query string true "Name of the application"
|
// @Param name query string true "Name of the application"
|
||||||
// @Param strict_compatability query boolean false "Use strict compatability mode"
|
// @Param strict_compatibility query boolean false "Use strict compatibility mode"
|
||||||
// @Success 200 {object} model.Application
|
// @Success 200 {object} model.Application
|
||||||
// @Failure 400 ""
|
// @Failure 400 ""
|
||||||
// @Security BasicAuth
|
// @Security BasicAuth
|
||||||
|
@ -243,7 +243,7 @@ func (h *ApplicationHandler) DeleteApplication(ctx *gin.Context) {
|
||||||
// @Param id path int true "ID of the application"
|
// @Param id path int true "ID of the application"
|
||||||
// @Param name query string false "New name for the application"
|
// @Param name query string false "New name for the application"
|
||||||
// @Param refresh_token query bool false "Generate new refresh token for the application"
|
// @Param refresh_token query bool false "Generate new refresh token for the application"
|
||||||
// @Param strict_compatability query bool false "Whether to use strict compataibility mode"
|
// @Param strict_compatibility query bool false "Whether to use strict compataibility mode"
|
||||||
// @Success 200 ""
|
// @Success 200 ""
|
||||||
// @Failure 500,404,403 ""
|
// @Failure 500,404,403 ""
|
||||||
// @Security BasicAuth
|
// @Security BasicAuth
|
||||||
|
|
|
@ -96,7 +96,7 @@ func TestApi_RegisterApplicationWithoutUser(t *testing.T) {
|
||||||
t.Fatalf(err.Error())
|
t.Fatalf(err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
assert.Panicsf(func() { TestApplicationHandler.CreateApplication(c) }, "CreateApplication did not panic altough user is not in context")
|
assert.Panicsf(func() { TestApplicationHandler.CreateApplication(c) }, "CreateApplication did not panic although user is not in context")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestApi_RegisterApplication(t *testing.T) {
|
func TestApi_RegisterApplication(t *testing.T) {
|
||||||
|
@ -186,7 +186,7 @@ func TestApi_GetApplicationsWithoutUser(t *testing.T) {
|
||||||
t.Fatalf(err.Error())
|
t.Fatalf(err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
assert.Panicsf(func() { TestApplicationHandler.GetApplications(c) }, "GetApplications did not panic altough user is not in context")
|
assert.Panicsf(func() { TestApplicationHandler.GetApplications(c) }, "GetApplications did not panic although user is not in context")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestApi_GetApplicationErrors(t *testing.T) {
|
func TestApi_GetApplicationErrors(t *testing.T) {
|
||||||
|
|
|
@ -12,7 +12,7 @@ import (
|
||||||
func getID(ctx *gin.Context) (uint, error) {
|
func getID(ctx *gin.Context) (uint, error) {
|
||||||
id, ok := ctx.MustGet("id").(uint)
|
id, ok := ctx.MustGet("id").(uint)
|
||||||
if !ok {
|
if !ok {
|
||||||
err := errors.New("an error occured while retrieving ID from context")
|
err := errors.New("an error occurred while retrieving ID from context")
|
||||||
ctx.AbortWithError(http.StatusInternalServerError, err)
|
ctx.AbortWithError(http.StatusInternalServerError, err)
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ func getID(ctx *gin.Context) (uint, error) {
|
||||||
func getMessageID(ctx *gin.Context) (string, error) {
|
func getMessageID(ctx *gin.Context) (string, error) {
|
||||||
id, ok := ctx.MustGet("messageid").(string)
|
id, ok := ctx.MustGet("messageid").(string)
|
||||||
if !ok {
|
if !ok {
|
||||||
err := errors.New("an error occured while retrieving messageID from context")
|
err := errors.New("an error occurred while retrieving messageID from context")
|
||||||
ctx.AbortWithError(http.StatusInternalServerError, err)
|
ctx.AbortWithError(http.StatusInternalServerError, err)
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,14 +39,14 @@ func TestApi_getID(t *testing.T) {
|
||||||
idReturned, err := getID(c)
|
idReturned, err := getID(c)
|
||||||
|
|
||||||
if req.ShouldStatus >= 200 && req.ShouldStatus < 300 {
|
if req.ShouldStatus >= 200 && req.ShouldStatus < 300 {
|
||||||
require.NoErrorf(err, "getId with id %v (%t) returned an error altough it should not: %v", id, id, err)
|
require.NoErrorf(err, "getId with id %v (%t) returned an error although it should not: %v", id, id, err)
|
||||||
|
|
||||||
idUint, ok := id.(uint)
|
idUint, ok := id.(uint)
|
||||||
if ok {
|
if ok {
|
||||||
assert.Equalf(idReturned, idUint, "getApi id was set to %d but result is %d", idUint, idReturned)
|
assert.Equalf(idReturned, idUint, "getApi id was set to %d but result is %d", idUint, idReturned)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
assert.Errorf(err, "getId with id %v (%t) returned no error altough it should", id, id)
|
assert.Errorf(err, "getId with id %v (%t) returned no error although it should", id, id)
|
||||||
}
|
}
|
||||||
|
|
||||||
assert.Equalf(w.Code, req.ShouldStatus, "getApi id was set to %v (%T) and should result in status code %d but code is %d", id, id, req.ShouldStatus, w.Code)
|
assert.Equalf(w.Code, req.ShouldStatus, "getApi id was set to %v (%T) and should result in status code %d but code is %d", id, id, req.ShouldStatus, w.Code)
|
||||||
|
@ -81,10 +81,10 @@ func TestApi_getApplication(t *testing.T) {
|
||||||
app, err := getApplication(c, TestDatabase)
|
app, err := getApplication(c, TestDatabase)
|
||||||
|
|
||||||
if req.ShouldStatus >= 200 && req.ShouldStatus < 300 {
|
if req.ShouldStatus >= 200 && req.ShouldStatus < 300 {
|
||||||
require.NoErrorf(err, "getApplication with id %v (%t) returned an error altough it should not: %v", id, id, err)
|
require.NoErrorf(err, "getApplication with id %v (%t) returned an error although it should not: %v", id, id, err)
|
||||||
assert.Equalf(app.ID, id, "getApplication id was set to %d but resulting app id is %d", id, app.ID)
|
assert.Equalf(app.ID, id, "getApplication id was set to %d but resulting app id is %d", id, app.ID)
|
||||||
} else {
|
} else {
|
||||||
assert.Errorf(err, "getApplication with id %v (%t) returned no error altough it should", id, id)
|
assert.Errorf(err, "getApplication with id %v (%t) returned no error although it should", id, id)
|
||||||
}
|
}
|
||||||
|
|
||||||
assert.Equalf(w.Code, req.ShouldStatus, "getApplication id was set to %v (%T) and should result in status code %d but code is %d", id, id, req.ShouldStatus, w.Code)
|
assert.Equalf(w.Code, req.ShouldStatus, "getApplication id was set to %v (%T) and should result in status code %d but code is %d", id, id, req.ShouldStatus, w.Code)
|
||||||
|
@ -116,11 +116,11 @@ func TestApi_getUser(t *testing.T) {
|
||||||
user, err := getUser(c, TestDatabase)
|
user, err := getUser(c, TestDatabase)
|
||||||
|
|
||||||
if req.ShouldStatus >= 200 && req.ShouldStatus < 300 {
|
if req.ShouldStatus >= 200 && req.ShouldStatus < 300 {
|
||||||
require.NoErrorf(err, "getUser with id %v (%t) returned an error altough it should not: %v", id, id, err)
|
require.NoErrorf(err, "getUser with id %v (%t) returned an error although it should not: %v", id, id, err)
|
||||||
assert.Equalf(user.ID, id, "getUser id was set to %d but resulting app id is %d", id, user.ID)
|
assert.Equalf(user.ID, id, "getUser id was set to %d but resulting app id is %d", id, user.ID)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
assert.Errorf(err, "getUser with id %v (%t) returned no error altough it should", id, id)
|
assert.Errorf(err, "getUser with id %v (%t) returned no error although it should", id, id)
|
||||||
}
|
}
|
||||||
|
|
||||||
assert.Equalf(w.Code, req.ShouldStatus, "getUser id was set to %v (%T) and should result in status code %d but code is %d", id, id, req.ShouldStatus, w.Code)
|
assert.Equalf(w.Code, req.ShouldStatus, "getUser id was set to %v (%T) and should result in status code %d but code is %d", id, id, req.ShouldStatus, w.Code)
|
||||||
|
|
|
@ -13,7 +13,7 @@ import (
|
||||||
func GetApplication(ctx *gin.Context) *model.Application {
|
func GetApplication(ctx *gin.Context) *model.Application {
|
||||||
app, ok := ctx.MustGet("app").(*model.Application)
|
app, ok := ctx.MustGet("app").(*model.Application)
|
||||||
if app == nil || !ok {
|
if app == nil || !ok {
|
||||||
ctx.AbortWithError(http.StatusInternalServerError, errors.New("an error occured while retrieving application from context"))
|
ctx.AbortWithError(http.StatusInternalServerError, errors.New("an error occurred while retrieving application from context"))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ func GetApplication(ctx *gin.Context) *model.Application {
|
||||||
func GetUser(ctx *gin.Context) *model.User {
|
func GetUser(ctx *gin.Context) *model.User {
|
||||||
user, ok := ctx.MustGet("user").(*model.User)
|
user, ok := ctx.MustGet("user").(*model.User)
|
||||||
if user == nil || !ok {
|
if user == nil || !ok {
|
||||||
ctx.AbortWithError(http.StatusInternalServerError, errors.New("an error occured while retrieving user from context"))
|
ctx.AbortWithError(http.StatusInternalServerError, errors.New("an error occurred while retrieving user from context"))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,7 @@ func TestConfiguration_GetEmpty(t *testing.T) {
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
assert.Panicsf(t, func() { Get() }, "Get() did not panic altough config is empty")
|
assert.Panicsf(t, func() { Get() }, "Get() did not panic although config is empty")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestConfiguration_GetInvalid(t *testing.T) {
|
func TestConfiguration_GetInvalid(t *testing.T) {
|
||||||
|
@ -72,7 +72,7 @@ func TestConfiguration_GetInvalid(t *testing.T) {
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
assert.Panicsf(t, func() { Get() }, "Get() did not panic altough config is empty")
|
assert.Panicsf(t, func() { Get() }, "Get() did not panic although config is empty")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestConfiguaration_ConfigFiles(t *testing.T) {
|
func TestConfiguaration_ConfigFiles(t *testing.T) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue