altera soa-edit-api para INCEPTION-INCREMENT
This commit is contained in:
@@ -151,6 +151,34 @@ func TestAuthCanBeDisabled(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestZoneRecordsPageShowsSOAEditAPI(t *testing.T) {
|
||||
client := &fakeClient{zone: pdns.Zone{
|
||||
Name: "example.org.",
|
||||
SOAEditAPI: "INCEPTION-INCREMENT",
|
||||
RRSets: []pdns.RRSet{{
|
||||
Name: "example.org.",
|
||||
Type: "SOA",
|
||||
TTL: 3600,
|
||||
}},
|
||||
}}
|
||||
srv, err := New(Config{}, client, nil)
|
||||
if err != nil {
|
||||
t.Fatalf("New returned error: %v", err)
|
||||
}
|
||||
|
||||
req := httptest.NewRequest(http.MethodGet, "/zones/example.org.", nil)
|
||||
rec := httptest.NewRecorder()
|
||||
srv.routes().ServeHTTP(rec, req)
|
||||
|
||||
if rec.Code != http.StatusOK {
|
||||
t.Fatalf("unexpected status: %d", rec.Code)
|
||||
}
|
||||
body := rec.Body.String()
|
||||
if !strings.Contains(body, "SOA-EDIT-API:") || !strings.Contains(body, "INCEPTION-INCREMENT") {
|
||||
t.Fatalf("expected SOA-EDIT-API value in zone records page, got %q", body)
|
||||
}
|
||||
}
|
||||
|
||||
func TestServesEmbeddedTablerAssets(t *testing.T) {
|
||||
srv, err := New(Config{}, &fakeClient{}, nil)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user