renamed SimpleStore receiver.

Fixes #12

Change-Id: If22752568e38843be48f25d9126dd9fd4d81c076
This commit is contained in:
sm
2016-03-01 23:51:29 -08:00
parent 2e4add8a1c
commit 20da49f37f
2 changed files with 44 additions and 27 deletions
+17
View File
@@ -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{