Skip to content

Commit 0317c54

Browse files
committed
better test code
* more acurate comments * use assert.False/True instead of Equal
1 parent 4facdc9 commit 0317c54

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

models/issue_watch_test.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ func TestGetIssueWatch(t *testing.T) {
2626
assert.NoError(t, PrepareTestDatabase())
2727

2828
_, exists, err := GetIssueWatch(9, 1)
29-
assert.Equal(t, true, exists)
29+
assert.True(t, exists)
3030
assert.NoError(t, err)
3131

3232
_, exists, err = GetIssueWatch(2, 2)
33-
assert.Equal(t, false, exists)
33+
assert.False(t, exists)
3434
assert.NoError(t, err)
3535

3636
_, exists, err = GetIssueWatch(3, 1)
37-
assert.Equal(t, false, exists)
37+
assert.False(t, exists)
3838
assert.NoError(t, err)
3939
}
4040

@@ -48,15 +48,16 @@ func TestGetIssueWatchers(t *testing.T) {
4848

4949
iws, err = GetIssueWatchers(2)
5050
assert.NoError(t, err)
51-
// Watcher is not watching
51+
// Watcher is explicit not watching
5252
assert.Equal(t, 0, len(iws))
5353

5454
iws, err = GetIssueWatchers(5)
5555
assert.NoError(t, err)
56+
// Issue has no Watchers
5657
assert.Equal(t, 0, len(iws))
5758

5859
iws, err = GetIssueWatchers(7)
5960
assert.NoError(t, err)
60-
// Watcher is not watching
61+
// Issue has one watcher
6162
assert.Equal(t, 1, len(iws))
6263
}

0 commit comments

Comments
 (0)