mirror of
https://github.com/lyx0/nourybot.git
synced 2024-11-13 19:49:55 +01:00
add tests for fistline and followage
This commit is contained in:
parent
36d36b4942
commit
fb84ff2d20
2 changed files with 36 additions and 0 deletions
18
pkg/api/ivr/firstline_test.go
Normal file
18
pkg/api/ivr/firstline_test.go
Normal file
|
@ -0,0 +1,18 @@
|
|||
package ivr
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestFirstLine(t *testing.T) {
|
||||
t.Run("returns a users first message in a channel", func(t *testing.T) {
|
||||
request, _ := FirstLine("forsen", "forsen")
|
||||
response := "forsen: EZ or Ezy (3y, 9mo, 16d ago)."
|
||||
|
||||
got := request
|
||||
want := response
|
||||
|
||||
if got != want {
|
||||
t.Errorf("got %q, want %q", got, want)
|
||||
}
|
||||
|
||||
})
|
||||
}
|
18
pkg/api/ivr/followage_test.go
Normal file
18
pkg/api/ivr/followage_test.go
Normal file
|
@ -0,0 +1,18 @@
|
|||
package ivr
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestFollowage(t *testing.T) {
|
||||
t.Run("returns a users date they followed a channel", func(t *testing.T) {
|
||||
request, _ := Followage("forsen", "pajlada")
|
||||
response := "pajlada has been following forsen since 2015-03-09."
|
||||
|
||||
got := request
|
||||
want := response
|
||||
|
||||
if got != want {
|
||||
t.Errorf("got %q, want %q", got, want)
|
||||
}
|
||||
|
||||
})
|
||||
}
|
Loading…
Reference in a new issue