Documentation ¶
Index ¶
- Variables
- func AllInstitutionNames(t *testing.T) []string
- func AllUserNames(t *testing.T) []string
- func AssertMatchesAll(t *testing.T, body string, items []string)
- func AssertMatchesNone(t *testing.T, body string, items []string)
- func AssertMatchesResultCount(t *testing.T, body string, count int)
- func ExtractCSRFToken(t *testing.T, html string) string
- func GetAnonymousClient(t *testing.T) *httpexpect.Expect
- func InitClient(t *testing.T, email string) (*httpexpect.Expect, string)
- func InitHTTPTests(t *testing.T)
- func InitUser(t *testing.T, email string) *pgmodels.User
- func InstUserNames(t *testing.T, institutionID int64) []string
- func OptionLabels(options []*forms.ListOption) []string
Constants ¶
This section is empty.
Variables ¶
var AllClients []*httpexpect.Expect
var AllInstNames []string
var BaseURL = "http://localhost"
var Inst1Admin *pgmodels.User
var Inst1AdminClient *httpexpect.Expect
var Inst1AdminToken string
var Inst1User *pgmodels.User
var Inst1UserClient *httpexpect.Expect
var Inst1UserToken string
var Inst2Admin *pgmodels.User
var Inst2AdminClient *httpexpect.Expect
var Inst2AdminToken string
var Inst2User *pgmodels.User
var Inst2UserClient *httpexpect.Expect
var Inst2UserToken string
var SmsUser *pgmodels.User
var SmsUserClient *httpexpect.Expect
var SmsUserToken string
var SysAdmin *pgmodels.User
var SysAdminClient *httpexpect.Expect
var SysAdminToken string
var TokenFor map[*httpexpect.Expect]string
var UserFor map[*httpexpect.Expect]*pgmodels.User
Functions ¶
func AllInstitutionNames ¶
AllInstitutionNames returns a list of all institution names in our test data, in no guaranteed order. We use this to ensure that pages containing institution lists do indeed display all institutions.
func AllUserNames ¶
AllUserNames returns a list of all user names in our test data, in no guaranteed order. We use this to ensure that pages containing user lists do indeed display all users.
func AssertMatchesAll ¶
AssertMatchesAll asserts that all strings in items appear in body.
func AssertMatchesNone ¶
AssertMatchesNone asserts that no strings in items appear in body.
func AssertMatchesResultCount ¶
MatchResult count asserts that the result count at the bottom of a list/index page matches the expected count. In the HTML pager, the result count appears in the format "1 - 20 of 215".
func ExtractCSRFToken ¶
Extract csrf token from http response, so we can include it it POST and PUT requests.
func GetAnonymousClient ¶
func InitHTTPTests ¶
func InstUserNames ¶
InstUserNames returns the names of all users at an institution.
func OptionLabels ¶
func OptionLabels(options []*forms.ListOption) []string
OptionLabels returns the text labels from a list of HTML options.
Types ¶
This section is empty.