feat: rename lists to projects
This commit is contained in:
@ -32,16 +32,16 @@ func TestInsertFromStructure(t *testing.T) {
|
||||
}
|
||||
t.Run("normal", func(t *testing.T) {
|
||||
db.LoadAndAssertFixtures(t)
|
||||
testStructure := []*models.NamespaceWithListsAndTasks{
|
||||
testStructure := []*models.NamespaceWithProjectsAndTasks{
|
||||
{
|
||||
Namespace: models.Namespace{
|
||||
Title: "Test1",
|
||||
Description: "Lorem Ipsum",
|
||||
},
|
||||
Lists: []*models.ListWithTasksAndBuckets{
|
||||
Projects: []*models.ProjectWithTasksAndBuckets{
|
||||
{
|
||||
List: models.List{
|
||||
Title: "Testlist1",
|
||||
Project: models.Project{
|
||||
Title: "Testproject1",
|
||||
Description: "Something",
|
||||
},
|
||||
Buckets: []*models.Bucket{
|
||||
@ -133,19 +133,19 @@ func TestInsertFromStructure(t *testing.T) {
|
||||
"title": testStructure[0].Namespace.Title,
|
||||
"description": testStructure[0].Namespace.Description,
|
||||
}, false)
|
||||
db.AssertExists(t, "lists", map[string]interface{}{
|
||||
"title": testStructure[0].Lists[0].Title,
|
||||
"description": testStructure[0].Lists[0].Description,
|
||||
db.AssertExists(t, "projects", map[string]interface{}{
|
||||
"title": testStructure[0].Projects[0].Title,
|
||||
"description": testStructure[0].Projects[0].Description,
|
||||
}, false)
|
||||
db.AssertExists(t, "tasks", map[string]interface{}{
|
||||
"title": testStructure[0].Lists[0].Tasks[5].Title,
|
||||
"bucket_id": testStructure[0].Lists[0].Buckets[0].ID,
|
||||
"title": testStructure[0].Projects[0].Tasks[5].Title,
|
||||
"bucket_id": testStructure[0].Projects[0].Buckets[0].ID,
|
||||
}, false)
|
||||
db.AssertMissing(t, "tasks", map[string]interface{}{
|
||||
"title": testStructure[0].Lists[0].Tasks[6].Title,
|
||||
"title": testStructure[0].Projects[0].Tasks[6].Title,
|
||||
"bucket_id": 1111, // No task with that bucket should exist
|
||||
})
|
||||
assert.NotEqual(t, 0, testStructure[0].Lists[0].Tasks[0].BucketID) // Should get the default bucket
|
||||
assert.NotEqual(t, 0, testStructure[0].Lists[0].Tasks[6].BucketID) // Should get the default bucket
|
||||
assert.NotEqual(t, 0, testStructure[0].Projects[0].Tasks[0].BucketID) // Should get the default bucket
|
||||
assert.NotEqual(t, 0, testStructure[0].Projects[0].Tasks[6].BucketID) // Should get the default bucket
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user