2020-04-09 05:29:28 +02:00
|
|
|
|
package persistence
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
. "github.com/onsi/ginkgo"
|
|
|
|
|
. "github.com/onsi/gomega"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
var _ = Describe("sqlRepository", func() {
|
|
|
|
|
Describe("getFullText", func() {
|
|
|
|
|
It("returns all lowercase chars", func() {
|
2020-04-20 04:40:24 +02:00
|
|
|
|
Expect(getFullText("Some Text")).To(Equal(" some text"))
|
2020-04-09 05:29:28 +02:00
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
It("removes accents", func() {
|
2020-04-20 04:40:24 +02:00
|
|
|
|
Expect(getFullText("Quintão")).To(Equal(" quintao"))
|
2020-04-09 05:29:28 +02:00
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
It("remove extra spaces", func() {
|
2020-04-20 04:40:24 +02:00
|
|
|
|
Expect(getFullText(" some text ")).To(Equal(" some text"))
|
2020-04-09 05:29:28 +02:00
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
It("remove duplicated words", func() {
|
2020-04-20 04:40:24 +02:00
|
|
|
|
Expect(getFullText("legião urbana urbana legiÃo")).To(Equal(" legiao urbana"))
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
It("remove symbols", func() {
|
|
|
|
|
Expect(getFullText("Tom’s Diner ' “40” ‘A’")).To(Equal(" 40 a diner toms"))
|
2020-04-09 05:29:28 +02:00
|
|
|
|
})
|
2020-05-25 17:05:30 +02:00
|
|
|
|
|
|
|
|
|
It("remove opening brackets", func() {
|
|
|
|
|
Expect(getFullText("[Five Years]")).To(Equal(" five years"))
|
|
|
|
|
})
|
2020-04-09 05:29:28 +02:00
|
|
|
|
})
|
|
|
|
|
})
|