allow upsert for duplicate key
Этот коммит содержится в:
@@ -95,7 +95,7 @@ func testLinkMetadataStoreSave(t *testing.T, ss store.Store) {
|
||||
assert.Equal(t, *metadata, *linkMetadata)
|
||||
})
|
||||
|
||||
t.Run("should not save with duplicate URL and timestamp, but should not return an error", func(t *testing.T) {
|
||||
t.Run("should save data with duplicate URL and timestamp", func(t *testing.T) {
|
||||
metadata := &model.LinkMetadata{
|
||||
URL: "http://example.com",
|
||||
Timestamp: getNextLinkMetadataTimestamp(),
|
||||
@@ -116,7 +116,7 @@ func testLinkMetadataStoreSave(t *testing.T, ss store.Store) {
|
||||
// Should return the original result, not the duplicate one
|
||||
linkMetadata, err = ss.LinkMetadata().Get(metadata.URL, metadata.Timestamp)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, &model.PostImage{}, linkMetadata.Data)
|
||||
assert.NotEqual(t, &model.PostImage{}, linkMetadata.Data)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user