+
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions github/orgs_audit_log.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (

// GetAuditLogOptions sets up optional parameters to query audit-log endpoint.
type GetAuditLogOptions struct {
Phrase *string `json:"phrase,omitempty"` // A search phrase. (Optional.)
Include *string `json:"include,omitempty"` // Event type includes. Can be one of "web", "git", "all". Default: "web". (Optional.)
Order *string `json:"order,omitempty"` // The order of audit log events. Can be one of "asc" or "desc". Default: "desc". (Optional.)
Phrase *string `url:"phrase,omitempty"` // A search phrase. (Optional.)
Include *string `url:"include,omitempty"` // Event type includes. Can be one of "web", "git", "all". Default: "web". (Optional.)
Order *string `url:"order,omitempty"` // The order of audit log events. Can be one of "asc" or "desc". Default: "desc". (Optional.)

ListCursorOptions
}
Expand Down
9 changes: 8 additions & 1 deletion github/orgs_audit_log_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"context"
"fmt"
"net/http"
"strings"
"testing"
"time"

Expand Down Expand Up @@ -57,7 +58,7 @@ func TestOrganizationService_GetAuditLog(t *testing.T) {
Order: String("asc"),
}

auditEntries, _, err := client.Organizations.GetAuditLog(ctx, "o", &getOpts)
auditEntries, resp, err := client.Organizations.GetAuditLog(ctx, "o", &getOpts)
if err != nil {
t.Errorf("Organizations.GetAuditLog returned error: %v", err)
}
Expand Down Expand Up @@ -97,6 +98,12 @@ func TestOrganizationService_GetAuditLog(t *testing.T) {
t.Errorf("Organizations.GetAuditLog return \ngot: %+v,\nwant:%+v", auditEntries, want)
}

// assert query string has lower case params
requestedQuery := resp.Request.URL.RawQuery
if !strings.Contains(requestedQuery, "phrase") {
t.Errorf("Organizations.GetAuditLog query string \ngot: %+v,\nwant:%+v", requestedQuery, "phrase")
}

const methodName = "GetAuditLog"
testBadOptions(t, methodName, func() (err error) {
_, _, err = client.Organizations.GetAuditLog(ctx, "\n", &getOpts)
Expand Down
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载