test with more user flds

This commit is contained in:
Umputun
2018-01-16 17:53:11 -06:00
parent 58cc0e75c9
commit 8b0c5a1385
2 changed files with 7 additions and 8 deletions
+2 -4
View File
@@ -3,15 +3,13 @@ package rest
import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"strings"
"testing"
"github.com/stretchr/testify/assert"
"io/ioutil"
"strings"
"github.com/stretchr/testify/require"
"github.com/umputun/remark/app/store"
)
+5 -4
View File
@@ -32,8 +32,8 @@ func TestAuth(t *testing.T) {
u := store.User{}
err = json.Unmarshal(body, &u)
assert.Nil(t, err)
assert.Equal(t, store.User{Name: "blah", ID: "myuser", Picture: "", Profile: "", Admin: false, Blocked: false, IP: ""}, u)
assert.Equal(t, store.User{Name: "blah", ID: "myuser", Picture: "", Profile: "http://blah.com/p.html",
Admin: false, Blocked: false, IP: ""}, u)
}
func TestLogout(t *testing.T) {
@@ -108,13 +108,14 @@ func mockProvider(t *testing.T, sessStore sessions.Store) (provder Provider, ts
case strings.HasPrefix(r.URL.Path, "/user"):
res := `{
"id":"myuser",
"name":"blah"
"name":"blah",
"profile": "http://blah.com/p.html"
}`
w.Header().Set("Content-Type", "application/json; charset=utf-8")
w.WriteHeader(200)
w.Write([]byte(res))
default:
t.Logf("unexpected oauth request %s %s", r.Method, r.URL)
t.Fatalf("unexpected oauth request %s %s", r.Method, r.URL)
}
}),
}