1
0

Ensure consistent naming of title fields (#528)

Remove task text and namespace name in migration

Fix lint

Add migration for namespace title

Fix renaming namespace name to title

Rename namespace name field to title

Drop text column at the end of the migration

Add migration for task text to title

Rename task text to title

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: https://kolaente.dev/vikunja/api/pulls/528
This commit is contained in:
konrad
2020-05-16 10:17:44 +00:00
parent 587ce92dc9
commit fe43173b6c
27 changed files with 476 additions and 248 deletions

View File

@ -36,7 +36,7 @@ func TestTask_Create(t *testing.T) {
t.Run("normal", func(t *testing.T) {
db.LoadAndAssertFixtures(t)
task := &Task{
Text: "Lorem",
Title: "Lorem",
Description: "Lorem Ipsum Dolor",
ListID: 1,
}
@ -51,10 +51,10 @@ func TestTask_Create(t *testing.T) {
assert.Equal(t, int64(1), task.BucketID)
})
t.Run("empty text", func(t *testing.T) {
t.Run("empty title", func(t *testing.T) {
db.LoadAndAssertFixtures(t)
task := &Task{
Text: "",
Title: "",
Description: "Lorem Ipsum Dolor",
ListID: 1,
}
@ -65,7 +65,7 @@ func TestTask_Create(t *testing.T) {
t.Run("nonexistant list", func(t *testing.T) {
db.LoadAndAssertFixtures(t)
task := &Task{
Text: "Test",
Title: "Test",
Description: "Lorem Ipsum Dolor",
ListID: 9999999,
}
@ -77,7 +77,7 @@ func TestTask_Create(t *testing.T) {
db.LoadAndAssertFixtures(t)
nUser := &user.User{ID: 99999999}
task := &Task{
Text: "Test",
Title: "Test",
Description: "Lorem Ipsum Dolor",
ListID: 1,
}
@ -92,7 +92,7 @@ func TestTask_Update(t *testing.T) {
db.LoadAndAssertFixtures(t)
task := &Task{
ID: 1,
Text: "test10000",
Title: "test10000",
Description: "Lorem Ipsum Dolor",
ListID: 1,
}
@ -103,7 +103,7 @@ func TestTask_Update(t *testing.T) {
db.LoadAndAssertFixtures(t)
task := &Task{
ID: 9999999,
Text: "test10000",
Title: "test10000",
Description: "Lorem Ipsum Dolor",
ListID: 1,
}
@ -215,7 +215,7 @@ func TestTask_ReadOne(t *testing.T) {
task := &Task{ID: 1}
err := task.ReadOne()
assert.NoError(t, err)
assert.Equal(t, "task #1", task.Text)
assert.Equal(t, "task #1", task.Title)
})
t.Run("nonexisting", func(t *testing.T) {
db.LoadAndAssertFixtures(t)