Skip to content

Commit 9f3b25c

Browse files
committed
fix test + add new case
1 parent 47ba722 commit 9f3b25c

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

models/fixtures/issue_watch.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,19 @@
1313
is_watching: false
1414
created_unix: 946684800
1515
updated_unix: 946684800
16+
17+
-
18+
id: 3
19+
user_id: 2
20+
issue_id: 3
21+
is_watching: true
22+
created_unix: 946684800
23+
updated_unix: 946684800
24+
25+
-
26+
id: 3
27+
user_id: 1
28+
issue_id: 3
29+
is_watching: false
30+
created_unix: 946684800
31+
updated_unix: 946684800

models/issue_watch_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ func TestGetIssueWatchers(t *testing.T) {
4848

4949
iws, err = GetIssueWatchers(2)
5050
assert.NoError(t, err)
51+
// Watcher is not watching
52+
assert.Equal(t, 0, len(iws))
53+
54+
iws, err = GetIssueWatchers(3)
55+
assert.NoError(t, err)
56+
// Watcher is not watching
5157
assert.Equal(t, 1, len(iws))
5258

5359
iws, err = GetIssueWatchers(5)

0 commit comments

Comments
 (0)