diff --git a/app/migrator/migrator_test.go b/app/migrator/migrator_test.go index 9558bb33..6f689eb5 100644 --- a/app/migrator/migrator_test.go +++ b/app/migrator/migrator_test.go @@ -7,6 +7,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/umputun/remark/app/store" ) diff --git a/app/rest/admin_test.go b/app/rest/admin_test.go index 185a46d5..5030d606 100644 --- a/app/rest/admin_test.go +++ b/app/rest/admin_test.go @@ -9,8 +9,8 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" + "github.com/umputun/remark/app/store" ) diff --git a/app/rest/auth/auth_test.go b/app/rest/auth/auth_test.go index 5ba19618..06bb5397 100644 --- a/app/rest/auth/auth_test.go +++ b/app/rest/auth/auth_test.go @@ -2,18 +2,18 @@ package auth import ( "encoding/json" + "fmt" "io/ioutil" "log" "net/http" "strings" "testing" - "fmt" - "github.com/gorilla/sessions" "github.com/stretchr/testify/assert" - "github.com/umputun/remark/app/store" "golang.org/x/oauth2" + + "github.com/umputun/remark/app/store" ) func TestAuth(t *testing.T) { diff --git a/app/rest/format/tree_test.go b/app/rest/format/tree_test.go index f4dd746b..0504875b 100644 --- a/app/rest/format/tree_test.go +++ b/app/rest/format/tree_test.go @@ -8,6 +8,7 @@ import ( "time" "github.com/stretchr/testify/assert" + "github.com/umputun/remark/app/store" ) diff --git a/app/store/service_test.go b/app/store/service_test.go index e41bf656..80cae747 100644 --- a/app/store/service_test.go +++ b/app/store/service_test.go @@ -17,12 +17,12 @@ func TestService_Vote(t *testing.T) { assert.Nil(t, err) assert.Equal(t, 2, len(res)) assert.Equal(t, 0, res[0].Score) - assert.Equal(t, map[string]bool{}, res[0].Votes) + assert.Equal(t, map[string]bool{}, res[0].Votes, "no votes initially") c, err := b.Vote(Locator{URL: "https://radio-t.com", SiteID: "radio-t"}, res[0].ID, "user1", true) assert.Nil(t, err) assert.Equal(t, 1, c.Score) - assert.Equal(t, map[string]bool{"user1": true}, c.Votes) + assert.Equal(t, map[string]bool{"user1": true}, c.Votes, "user voted +") _, err = b.Vote(Locator{URL: "https://radio-t.com", SiteID: "radio-t"}, res[0].ID, "user1", true) assert.NotNil(t, err, "double-voting rejected") @@ -38,7 +38,7 @@ func TestService_Vote(t *testing.T) { assert.Nil(t, err) assert.Equal(t, 2, len(res)) assert.Equal(t, 0, res[0].Score) - assert.Equal(t, map[string]bool{}, res[0].Votes) + assert.Equal(t, map[string]bool{}, res[0].Votes, "vote reset ok") } func TestBoltDB_Pin(t *testing.T) {