renamed SimpleStore receiver.
Fixes #12 Change-Id: If22752568e38843be48f25d9126dd9fd4d81c076
This commit is contained in:
+17
@@ -224,6 +224,23 @@ func TestBadJson(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestBadVcs(t *testing.T) {
|
||||
ms := NewSimpleStore("")
|
||||
s := &Server{
|
||||
storage: ms,
|
||||
}
|
||||
ts := httptest.NewServer(s)
|
||||
url := fmt.Sprintf("%s/foo", ts.URL)
|
||||
resp, err := http.Post(url, "application/json", strings.NewReader(`{"vcs": "bitbucket", "repo": "https://s.mcquay.me/sm/vain"}`))
|
||||
if err != nil {
|
||||
t.Errorf("couldn't POST: %v", err)
|
||||
}
|
||||
resp.Body.Close()
|
||||
if got, want := resp.StatusCode, http.StatusBadRequest; got != want {
|
||||
t.Errorf("should have reported bad vcs specified; got %v, want %v", http.StatusText(got), http.StatusText(want))
|
||||
}
|
||||
}
|
||||
|
||||
func TestUnsupportedMethod(t *testing.T) {
|
||||
ms := NewSimpleStore("")
|
||||
s := &Server{
|
||||
|
||||
Reference in New Issue
Block a user