Forgot about non-sequentiality. Fingers crossed this works.
This commit is contained in:
parent
72edfc3566
commit
69211688f4
|
@ -24,8 +24,6 @@ func addContext(ctx context.Context) client.Option {
|
||||||
func TestAlbumCover(t *testing.T) {
|
func TestAlbumCover(t *testing.T) {
|
||||||
db := test_utils.DatabaseTest(t)
|
db := test_utils.DatabaseTest(t)
|
||||||
|
|
||||||
TestCoverID := 6
|
|
||||||
|
|
||||||
rootAlbum := models.Album{
|
rootAlbum := models.Album{
|
||||||
Title: "root",
|
Title: "root",
|
||||||
Path: "/photos",
|
Path: "/photos",
|
||||||
|
@ -45,7 +43,6 @@ func TestAlbumCover(t *testing.T) {
|
||||||
Title: "child2",
|
Title: "child2",
|
||||||
Path: "/photos/child2",
|
Path: "/photos/child2",
|
||||||
ParentAlbumID: &rootAlbum.ID,
|
ParentAlbumID: &rootAlbum.ID,
|
||||||
CoverID: &TestCoverID,
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,6 +87,10 @@ func TestAlbumCover(t *testing.T) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !assert.NoError(t, db.Model(&children[1]).Update("cover_id", &photos[5].ID).Error) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
pass := "<hashed_password>"
|
pass := "<hashed_password>"
|
||||||
regularUser := models.User{
|
regularUser := models.User{
|
||||||
Username: "user1",
|
Username: "user1",
|
||||||
|
@ -167,7 +168,7 @@ func TestAlbumCover(t *testing.T) {
|
||||||
postErr := c.Post(
|
postErr := c.Post(
|
||||||
q,
|
q,
|
||||||
&resp,
|
&resp,
|
||||||
client.Var("albumID", &children[1].ID),
|
client.Var("albumID", &children[0].ID),
|
||||||
addContext(ctx),
|
addContext(ctx),
|
||||||
)
|
)
|
||||||
if !assert.NoError(t, postErr) {
|
if !assert.NoError(t, postErr) {
|
||||||
|
|
Loading…
Reference in New Issue