2017-12-30 16:01:51 -06:00
|
|
|
package imguploader
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"testing"
|
|
|
|
|
2021-07-02 06:22:47 -05:00
|
|
|
"github.com/stretchr/testify/require"
|
2017-12-30 16:01:51 -06:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestUploadToLocal(t *testing.T) {
|
2021-07-02 06:22:47 -05:00
|
|
|
t.Run("[Integration test] for external_image_store.local", func(t *testing.T) {
|
2017-12-30 16:01:51 -06:00
|
|
|
localUploader, _ := NewLocalImageUploader()
|
|
|
|
path, err := localUploader.Upload(context.Background(), "../../../public/img/logo_transparent_400x.png")
|
|
|
|
|
2021-07-02 06:22:47 -05:00
|
|
|
require.NoError(t, err)
|
|
|
|
require.Contains(t, path, "/public/img/attachments")
|
2017-12-30 16:01:51 -06:00
|
|
|
})
|
|
|
|
}
|