Use MBID with most occurrences
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package persistence
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/Masterminds/squirrel"
|
||||
@@ -61,4 +62,16 @@ var _ = Describe("Helpers", func() {
|
||||
Expect(err).To(BeNil())
|
||||
})
|
||||
})
|
||||
|
||||
Describe("getMbzId", func() {
|
||||
It(`returns "" when no ids are passed`, func() {
|
||||
Expect(getMbzId(context.TODO(), " ", "", "")).To(Equal(""))
|
||||
})
|
||||
It(`returns the only id passed`, func() {
|
||||
Expect(getMbzId(context.TODO(), "1234 ", "", "")).To(Equal("1234"))
|
||||
})
|
||||
It(`returns the id with higher frequency`, func() {
|
||||
Expect(getMbzId(context.TODO(), "1 2 3 4 1", "", "")).To(Equal("1"))
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user