Fix tests and lint errors, plus a bit of refactor
This commit is contained in:
+1
-1
@@ -74,7 +74,7 @@ func (s *shareService) loadMediafiles(ctx context.Context, filter squirrel.Eq, s
|
||||
|
||||
func (s *shareService) loadPlaylistTracks(ctx context.Context, id string) (model.MediaFiles, error) {
|
||||
// Create a context with a fake admin user, to be able to access playlists
|
||||
ctx = request.WithUser(context.TODO(), model.User{IsAdmin: true})
|
||||
ctx = request.WithUser(ctx, model.User{IsAdmin: true})
|
||||
|
||||
tracks, err := s.ds.Playlist(ctx).Tracks(id, true).GetAll(model.QueryOptions{Sort: "id"})
|
||||
if err != nil {
|
||||
|
||||
+2
-2
@@ -29,7 +29,7 @@ var _ = Describe("Share", func() {
|
||||
})
|
||||
|
||||
Describe("Save", func() {
|
||||
It("it adds a random name", func() {
|
||||
It("it sets a random ID", func() {
|
||||
entity := &model.Share{Description: "test"}
|
||||
id, err := repo.Save(entity)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
@@ -44,7 +44,7 @@ var _ = Describe("Share", func() {
|
||||
err := repo.Update("id", entity)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(mockedRepo.(*tests.MockShareRepo).Entity).To(Equal("entity"))
|
||||
Expect(mockedRepo.(*tests.MockShareRepo).Cols).To(ConsistOf("description"))
|
||||
Expect(mockedRepo.(*tests.MockShareRepo).Cols).To(ConsistOf("description", "expires_at"))
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user