fix: Allow spaces in searches (#2723)

This commit is contained in:
Steven Masley
2022-06-29 11:59:38 -05:00
committed by GitHub
parent 889e2e68ea
commit baa36182c0
3 changed files with 19 additions and 2 deletions

View File

@ -33,6 +33,15 @@ func TestSearchUsers(t *testing.T) {
RbacRole: []string{},
},
},
{
Name: "UsernameWithSpaces",
Query: " user-name ",
Expected: database.GetUsersParams{
Search: "user-name",
Status: []database.UserStatus{},
RbacRole: []string{},
},
},
{
Name: "Username+Param",
Query: "usEr-name stAtus:actiVe",

View File

@ -31,6 +31,14 @@ func TestSearchWorkspace(t *testing.T) {
Name: "bar",
},
},
{
Name: "Owner/NameWithSpaces",
Query: " Foo/Bar ",
Expected: database.GetWorkspacesParams{
OwnerUsername: "foo",
Name: "bar",
},
},
{
Name: "Name",
Query: "workspace-name",