fix(project): duplicating a project should not create two backlog buckets
Resolves https://community.vikunja.io/t/when-duplicating-a-project-the-resulting-project-has-an-extra-bucket/1524
This commit is contained in:
@ -44,6 +44,14 @@ func TestProjectDuplicate(t *testing.T) {
|
||||
assert.True(t, can)
|
||||
err = l.Create(s, u)
|
||||
assert.NoError(t, err)
|
||||
|
||||
// assert the new project has the same number of buckets as the old one
|
||||
numberOfOriginalBuckets, err := s.Where("project_id = ?", l.ProjectID).Count(&Bucket{})
|
||||
assert.NoError(t, err)
|
||||
numberOfDuplicatedBuckets, err := s.Where("project_id = ?", l.Project.ID).Count(&Bucket{})
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, numberOfOriginalBuckets, numberOfDuplicatedBuckets, "duplicated project does not have the same amount of buckets as the original one")
|
||||
|
||||
// To make this test 100% useful, it would need to assert a lot more stuff, but it is good enough for now.
|
||||
// Also, we're lacking utility functions to do all needed assertions.
|
||||
}
|
||||
|
Reference in New Issue
Block a user