(t *testing.T)
| 49 | } |
| 50 | |
| 51 | func TestAPI_Version(t *testing.T) { |
| 52 | mux, _ := setupAPI(t) |
| 53 | |
| 54 | r := httptest.NewRequest("GET", "/api/version", nil) |
| 55 | w := httptest.NewRecorder() |
| 56 | mux.ServeHTTP(w, r) |
| 57 | |
| 58 | if w.Code != 200 { |
| 59 | t.Fatalf("status = %d", w.Code) |
| 60 | } |
| 61 | var resp map[string]string |
| 62 | json.NewDecoder(w.Body).Decode(&resp) |
| 63 | if resp["version"] != "test-version" { |
| 64 | t.Errorf("version = %q", resp["version"]) |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | func TestAPI_Settings(t *testing.T) { |
| 69 | mux, _ := setupAPI(t) |