-
Notifications
You must be signed in to change notification settings - Fork 0
/
stars_test.go
36 lines (30 loc) · 720 Bytes
/
stars_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package main
import (
"testing"
"github.com/bfontaine/stargazer/Godeps/_workspace/src/github.com/nlopes/slack"
"github.com/bfontaine/stargazer/Godeps/_workspace/src/github.com/stretchr/testify/assert"
)
func TestStarNotification(t *testing.T) {
s := Star{
Added: true,
User: "U123",
Timestamp: "1401",
Message: Message{
User: "U321",
Channel: "C123",
Text: "yo",
Timestamp: "1400",
},
}
slackInfo = &slack.Info{
Team: &slack.Team{
Name: "yolo",
Domain: "yoloo",
},
}
n, err := s.notification()
assert.Nil(t, err)
assert.Equal(t,
"@usernameU123 just starred your message in #channelC123: https://yoloo.slack.com/archives/channelC123/p1400",
n)
}