mirror of https://github.com/perkeep/perkeep.git
importer: add test that fails at Go tip
Updates #1090 Change-Id: I16ee3cfd49ba9af2b98cdef470932ca000d768dc
This commit is contained in:
parent
c193a87ae1
commit
f41a431595
|
@ -17,6 +17,8 @@ limitations under the License.
|
|||
package importer
|
||||
|
||||
import (
|
||||
"net/http/httptest"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"go4.org/jsonconfig"
|
||||
|
@ -64,3 +66,16 @@ func TestStaticConfig(t *testing.T) {
|
|||
t.Errorf("expected error from secret without id")
|
||||
}
|
||||
}
|
||||
|
||||
func TestImportRootPageHTML(t *testing.T) {
|
||||
h, err := NewHost(HostConfig{})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
w := httptest.NewRecorder()
|
||||
r := httptest.NewRequest("GET", "/importer/", nil)
|
||||
h.serveImportersRoot(w, r)
|
||||
if w.Code != 200 || !strings.Contains(w.Body.String(), "dummy1") {
|
||||
t.Errorf("Got %d response with header %v, body %s", w.Code, w.HeaderMap, w.Body.String())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue