Initial commit of Descrybe v2 without local scratch artifacts.
Drop one-shot tmp/axe scripts and agent i18n scratch so the Gitea tree is deployable.
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
package httpapi
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestQueryTruthyWithoutActivePlan(t *testing.T) {
|
||||
t.Parallel()
|
||||
req := httptest.NewRequest(http.MethodGet, "/api/admin/companies?without_active_plan=1", nil)
|
||||
if !QueryTruthy(req, "without_active_plan") {
|
||||
t.Fatal("expected without_active_plan=1 to be truthy")
|
||||
}
|
||||
req = httptest.NewRequest(http.MethodGet, "/api/admin/companies", nil)
|
||||
if QueryTruthy(req, "without_active_plan") {
|
||||
t.Fatal("expected missing flag to be false")
|
||||
}
|
||||
}
|
||||
|
||||
func TestQueryTruthyWithoutAPIKeys(t *testing.T) {
|
||||
t.Parallel()
|
||||
req := httptest.NewRequest(http.MethodGet, "/api/admin/companies?without_api_keys=1", nil)
|
||||
if !QueryTruthy(req, "without_api_keys") {
|
||||
t.Fatal("expected without_api_keys=1 to be truthy")
|
||||
}
|
||||
req = httptest.NewRequest(http.MethodGet, "/api/admin/companies", nil)
|
||||
if QueryTruthy(req, "without_api_keys") {
|
||||
t.Fatal("expected missing without_api_keys to be false")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user