fix(task): ambiguous description search (#1032)
test: relocate search regression
This commit is contained in:
parent
bddba8646d
commit
c6c18d1ca1
|
|
@ -78,3 +78,21 @@ func TestTaskCollection_SubtaskRemainsAfterMove(t *testing.T) {
|
|||
}
|
||||
assert.True(t, found, "subtask should be returned after moving to another project")
|
||||
}
|
||||
|
||||
func TestTaskSearchWithExpandSubtasks(t *testing.T) {
|
||||
db.LoadAndAssertFixtures(t)
|
||||
s := db.NewSession()
|
||||
defer s.Close()
|
||||
|
||||
project, err := GetProjectSimpleByID(s, 36)
|
||||
require.NoError(t, err)
|
||||
|
||||
opts := &taskSearchOptions{
|
||||
search: "Caldav",
|
||||
expand: []TaskCollectionExpandable{TaskCollectionExpandSubtasks},
|
||||
}
|
||||
|
||||
tasks, _, _, err := getRawTasksForProjects(s, []*Project{project}, &user.User{ID: 15}, opts)
|
||||
require.NoError(t, err)
|
||||
require.NotEmpty(t, tasks)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -283,7 +283,7 @@ func (d *dbTaskSearcher) Search(opts *taskSearchOptions) (tasks []*Task, totalCo
|
|||
where =
|
||||
builder.Or(
|
||||
db.ILIKE("tasks.title", opts.search),
|
||||
db.ILIKE("description", opts.search),
|
||||
db.ILIKE("tasks.description", opts.search),
|
||||
)
|
||||
|
||||
searchIndex := getTaskIndexFromSearchString(opts.search)
|
||||
|
|
|
|||
Loading…
Reference in New Issue