testhelpers

package
v1.13.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 25, 2023 License: MIT Imports: 56 Imported by: 0

Documentation

Overview

Package testhelpers provides the interface and features to run the Gherkin tests.

Index

Constants

View Source
const (
	UserGroupID = "group_id"
	UserLogin   = "login"
)
View Source
const (
	ReferencePrefix = '@'
)

Variables

This section is empty.

Functions

func BindGodogCmdFlags added in v1.9.0

func BindGodogCmdFlags()

BindGodogCmdFlags binds the command arguments into the Godog options.

func EmptyDB

func EmptyDB(db *sql.DB)

EmptyDB empties all tables of the database specified in the config.

func FeatureContext

func FeatureContext(s *godog.Suite)

FeatureContext binds the supported steps to the verifying functions.

func InsertBatch

func InsertBatch(db *sql.DB, tableName string, data []map[string]interface{})

InsertBatch insert the data into the table with the name given.

func LoadFixture

func LoadFixture(db *sql.DB, fileName string)

LoadFixture loads fixtures from `<current_pkg_dir>/testdata/<fileName>/` directory or `<current_pkg_dir>/testdata/<fileName>` file. Each file in this directory must be in yaml format. If a file name satisfies '*.chain.yaml' mask, the file is treated as a tableName->[]dataRow map. Otherwise, data will be loaded into table with the same name as the filename (without extension). Note that you should probably empty the DB before using this function.

func MockDBTime

func MockDBTime(timeStrRaw string)

MockDBTime replaces the DB NOW() function call with a given constant value in all the queries.

func OpenRawDBConnection

func OpenRawDBConnection() (*sql.DB, error)

OpenRawDBConnection creates a new connection to the DB specified in the config.

func RestoreDBTime

func RestoreDBTime()

RestoreDBTime restores the usual behavior of the NOW() function.

func RunConcurrently

func RunConcurrently(f func(), threadsNumber int)

RunConcurrently runs a given function concurrently.

func RunGodogTests

func RunGodogTests(t *testing.T, tags string)

RunGodogTests launches GoDog tests (bdd tests) for the current directory (the one from the tested package).

func SetupDBWithFixture

func SetupDBWithFixture(fixtureNames ...string) *database.DB

SetupDBWithFixture creates a new DB connection, empties the DB, and loads a fixture.

func SetupDBWithFixtureString

func SetupDBWithFixtureString(fixtures ...string) *database.DB

SetupDBWithFixtureString creates a new DB connection, empties the DB, and loads fixtures from the strings (yaml with a tableName->[]dataRow map).

func ValidateJSONContentType

func ValidateJSONContentType(resp *http.Response) error

ValidateJSONContentType validates the content-type header of the response is json If not, return an error.

Types

type TestContext

type TestContext struct {
	// contains filtered or unexported fields
}

TestContext implements context for tests.

func (*TestContext) AllUsersGroupIsDefinedAsTheGroup added in v1.10.0

func (ctx *TestContext) AllUsersGroupIsDefinedAsTheGroup(group string) error

AllUsersGroupIsDefinedAsTheGroup creates and sets the allUsersGroup.

func (*TestContext) DBGroupsAncestorsAreComputed

func (ctx *TestContext) DBGroupsAncestorsAreComputed() error

DBGroupsAncestorsAreComputed computes the groups_ancestors table.

func (*TestContext) DBHasTable

func (ctx *TestContext) DBHasTable(table string, data *messages.PickleStepArgument_PickleTable) error

func (*TestContext) DBHasUsers

func (ctx *TestContext) DBHasUsers(data *messages.PickleStepArgument_PickleTable) error

func (*TestContext) DBItemsAncestorsAndPermissionsAreComputed added in v1.9.0

func (ctx *TestContext) DBItemsAncestorsAndPermissionsAreComputed() error

DBItemsAncestorsAndPermissionsAreComputed computes the items_ancestors and permissions_generated tables.

func (*TestContext) DbTimeNow

func (ctx *TestContext) DbTimeNow(timeStrRaw string) error

func (*TestContext) GroupIsAChildOfTheGroup added in v1.9.0

func (ctx *TestContext) GroupIsAChildOfTheGroup(childGroup, parentGroup string) error

GroupIsAChildOfTheGroup puts a group as a child of another group.

func (*TestContext) IAm added in v1.8.0

func (ctx *TestContext) IAm(name string) error

IAm Sets the current user.

func (*TestContext) IAmAManagerOfTheGroup added in v1.9.0

func (ctx *TestContext) IAmAManagerOfTheGroup(group string) error

IAmAManagerOfTheGroup sets the user as a manager of a group with an id.

func (*TestContext) IAmAManagerOfTheGroupAndCanWatchItsMembers added in v1.9.0

func (ctx *TestContext) IAmAManagerOfTheGroupAndCanWatchItsMembers(group string) error

IAmAManagerOfTheGroupAndCanWatchItsMembers sets the user as a manager of a group with can_watch permission.

func (*TestContext) IAmAManagerOfTheGroupWithID added in v1.9.0

func (ctx *TestContext) IAmAManagerOfTheGroupWithID(group string) error

IAmAManagerOfTheGroupWithID sets the user as a manager of a group with an id.

func (*TestContext) IAmAMemberOfTheGroup added in v1.9.0

func (ctx *TestContext) IAmAMemberOfTheGroup(name string) error

IAmAMemberOfTheGroup puts a user in a group.

func (*TestContext) IAmAMemberOfTheGroupWithID added in v1.8.0

func (ctx *TestContext) IAmAMemberOfTheGroupWithID(group string) error

IAmAMemberOfTheGroupWithID creates a group and add the user in it.

func (*TestContext) IAmPartOfTheHelperGroupOfTheThread added in v1.8.0

func (ctx *TestContext) IAmPartOfTheHelperGroupOfTheThread() error

IAmPartOfTheHelperGroupOfTheThread states that user is a member of the helper group, of a given thread.

func (*TestContext) IAmUserWithID

func (ctx *TestContext) IAmUserWithID(userID int64) error

IAmUserWithID sets the current logged user to the one with the provided ID.

func (*TestContext) ICanOnItemWithID added in v1.8.0

func (ctx *TestContext) ICanOnItemWithID(watchType, watchValue, item string) error

ICanOnItemWithID gives the user a permission on an item.

func (*TestContext) ICanRequestHelpToTheGroupWithIDOnTheItemWithID added in v1.8.0

func (ctx *TestContext) ICanRequestHelpToTheGroupWithIDOnTheItemWithID(group, item string) error

ICanRequestHelpToTheGroupWithIDOnTheItemWithID gives the user the permission to request help from a given group to a given item.

func (*TestContext) ICanViewOnItemWithID added in v1.8.0

func (ctx *TestContext) ICanViewOnItemWithID(viewValue, item string) error

ICanViewOnItemWithID gives the user a "view" permission on an item.

func (*TestContext) ICanWatchGroup added in v1.9.0

func (ctx *TestContext) ICanWatchGroup(groupName string) error

ICanWatchGroup adds the permission for the user to watch a group.

func (*TestContext) ICanWatchGroupWithID added in v1.9.0

func (ctx *TestContext) ICanWatchGroupWithID(group string) error

ICanWatchGroupWithID adds the permission for the user to watch a group.

func (*TestContext) ICanWatchOnItemWithID added in v1.8.0

func (ctx *TestContext) ICanWatchOnItemWithID(watchValue, item string) error

ICanWatchOnItemWithID gives the user a "watch" permission on an item.

func (*TestContext) IHaveValidatedItemWithID added in v1.8.0

func (ctx *TestContext) IHaveValidatedItemWithID(item string) error

IHaveValidatedItemWithID states that user has validated an item.

func (*TestContext) ISendrequestTo

func (ctx *TestContext) ISendrequestTo(method string, path string) error

func (*TestContext) ISendrequestToWithBody

func (ctx *TestContext) ISendrequestToWithBody(method string, path string, body *messages.PickleStepArgument_PickleDocString) error

func (*TestContext) IsAMemberOfTheGroup added in v1.9.0

func (ctx *TestContext) IsAMemberOfTheGroup(childGroupName, parentGroupName string)

IsAMemberOfTheGroup Puts a group in a group.

func (*TestContext) ItShouldBeAJSONArrayWithEntries

func (ctx *TestContext) ItShouldBeAJSONArrayWithEntries(count int) error

func (*TestContext) ItemRelationSetPropagation added in v1.12.0

func (ctx *TestContext) ItemRelationSetPropagation(propagation, value, parent, item string) error

ItemRelationSetPropagation adds a propagation on an item relation.

func (*TestContext) LogsShouldContain

func (ctx *TestContext) LogsShouldContain(docString *messages.PickleStepArgument_PickleDocString) error

LogsShouldContain checks that the logs contain a provided string.

func (*TestContext) ScenarioTeardown

func (ctx *TestContext) ScenarioTeardown(*messages.Pickle, error)

ScenarioTeardown is called after each scenario to remove stubs.

func (*TestContext) SetupTestContext

func (ctx *TestContext) SetupTestContext(pickle *messages.Pickle)

SetupTestContext initializes the test context. Called before each scenario.

func (*TestContext) SignedTokenIsDistributed

func (ctx *TestContext) SignedTokenIsDistributed(
	varName, signerName string,
	jsonPayload *messages.PickleStepArgument_PickleDocString,
) error

SignedTokenIsDistributed declares a signed token and puts it in a global variable. This allows later use inside a request, or a comparison with a response.

func (*TestContext) TableAtColumnValueShouldBe

func (ctx *TestContext) TableAtColumnValueShouldBe(table, column, values string, data *messages.PickleStepArgument_PickleTable) error

func (*TestContext) TableAtColumnValueShouldBeEmpty

func (ctx *TestContext) TableAtColumnValueShouldBeEmpty(table string, column, valuesStr string) error

func (*TestContext) TableShouldBe

func (ctx *TestContext) TableShouldBe(table string, data *messages.PickleStepArgument_PickleTable) error

func (*TestContext) TableShouldBeEmpty

func (ctx *TestContext) TableShouldBeEmpty(table string) error

func (*TestContext) TableShouldNotContainColumnValue

func (ctx *TestContext) TableShouldNotContainColumnValue(table, column, values string) error

func (*TestContext) TableShouldStayUnchanged

func (ctx *TestContext) TableShouldStayUnchanged(table string) error

func (*TestContext) TableShouldStayUnchangedButTheRowWithColumnValue

func (ctx *TestContext) TableShouldStayUnchangedButTheRowWithColumnValue(table, column, values string) error

func (*TestContext) TableShouldStayUnchangedButTheRowsWithColumnValueShouldBeDeleted added in v1.8.0

func (ctx *TestContext) TableShouldStayUnchangedButTheRowsWithColumnValueShouldBeDeleted(table, columns, values string) error

TableShouldStayUnchangedButTheRowsWithColumnValueShouldBeDeleted checks for row deletion.

func (*TestContext) TheApplicationConfigIs

func (ctx *TestContext) TheApplicationConfigIs(yamlConfig *messages.PickleStepArgument_PickleDocString) error

TheApplicationConfigIs specifies variables of the app configuration given in YAML format.

func (*TestContext) TheContextVariableIs

func (ctx *TestContext) TheContextVariableIs(variableName, value string) error

TheContextVariableIs sets a context variable in the request http.Request as the provided value. Can be retrieved from the request with r.Context().Value("variableName").

func (*TestContext) TheGeneratedAuthKeyIs

func (ctx *TestContext) TheGeneratedAuthKeyIs(generatedKey string) error

TheGeneratedAuthKeyIs stubs auth.GenerateKey to return the provided auth key instead of a random one.

func (*TestContext) TheGeneratedGroupCodeIs

func (ctx *TestContext) TheGeneratedGroupCodeIs(generatedCode string) error

TheGeneratedGroupCodeIs stubs groups.GenerateGroupCode to return the provided code instead of a random one.

func (*TestContext) TheGeneratedGroupCodesAre

func (ctx *TestContext) TheGeneratedGroupCodesAre(generatedCodes string) error

TheGeneratedGroupCodesAre stubs groups.GenerateGroupCode to generate the provided codes instead of random ones. generatedCodes is in the following form: example for three codes: "code1","code2","code3" with an arbitrary number of codes.

func (*TestContext) TheLoginModuleAccountEndpointForTokenReturns

func (ctx *TestContext) TheLoginModuleAccountEndpointForTokenReturns(
	authToken string,
	statusCode int,
	body *messages.PickleStepArgument_PickleDocString,
) error

TheLoginModuleAccountEndpointForTokenReturns mocks the return of the login module /user_api/account with the provided authorization token.

func (*TestContext) TheLoginModuleCreateEndpointWithParamsReturns

func (ctx *TestContext) TheLoginModuleCreateEndpointWithParamsReturns(
	params string, statusCode int, body *messages.PickleStepArgument_PickleDocString,
) error

TheLoginModuleCreateEndpointWithParamsReturns mocks the return of the login module /platform_api/accounts_manager/create with the provided parameters, return status, and body.

func (*TestContext) TheLoginModuleDeleteEndpointWithParamsReturns

func (ctx *TestContext) TheLoginModuleDeleteEndpointWithParamsReturns(
	params string, statusCode int, body *messages.PickleStepArgument_PickleDocString,
) error

TheLoginModuleDeleteEndpointWithParamsReturns mocks the return of the login module /platform_api/accounts_manager/delete with the provided parameters, return status, and body.

func (*TestContext) TheLoginModuleLTIResultSendEndpointForUserIDContentIDScoreReturns

func (ctx *TestContext) TheLoginModuleLTIResultSendEndpointForUserIDContentIDScoreReturns(
	userID, contentID, score string, statusCode int, body *messages.PickleStepArgument_PickleDocString,
) error

TheLoginModuleLTIResultSendEndpointForUserIDContentIDScoreReturns mocks the return of the login module /platform_api/lti_result/send with the provided user_id, content_id, and score.

func (*TestContext) TheLoginModuleTokenEndpointForCodeAndCodeVerifierAndRedirectURIReturns

func (ctx *TestContext) TheLoginModuleTokenEndpointForCodeAndCodeVerifierAndRedirectURIReturns(
	code, codeVerifier, redirectURI string,
	statusCode int,
	body *messages.PickleStepArgument_PickleDocString,
) error

TheLoginModuleTokenEndpointForCodeAndCodeVerifierAndRedirectURIReturns mocks the return of the login module /oauth/token, called with the provided code, code_verifier, and redirect_uri.

func (*TestContext) TheLoginModuleTokenEndpointForCodeAndCodeVerifierReturns

func (ctx *TestContext) TheLoginModuleTokenEndpointForCodeAndCodeVerifierReturns(
	code, codeVerifier string,
	statusCode int,
	body *messages.PickleStepArgument_PickleDocString,
) error

TheLoginModuleTokenEndpointForCodeAndCodeVerifierReturns mocks the return of the login module /oauth/token, called with the provided code and code_verifier.

func (*TestContext) TheLoginModuleTokenEndpointForCodeReturns

func (ctx *TestContext) TheLoginModuleTokenEndpointForCodeReturns(
	code string,
	statusCode int,
	body *messages.PickleStepArgument_PickleDocString,
) error

TheLoginModuleTokenEndpointForCodeReturns mocks the return of the login module /oauth/token, called with a provided code.

func (*TestContext) TheLoginModuleTokenEndpointForRefreshTokenReturns

func (ctx *TestContext) TheLoginModuleTokenEndpointForRefreshTokenReturns(
	refreshToken string,
	statusCode int,
	body *messages.PickleStepArgument_PickleDocString,
) error

TheLoginModuleTokenEndpointForRefreshTokenReturns mocks the return of the login module /oauth/token, called with the provided refresh_token.

func (*TestContext) TheLoginModuleUnlinkClientEndpointForUserIDReturns

func (ctx *TestContext) TheLoginModuleUnlinkClientEndpointForUserIDReturns(
	userID string, statusCode int, body *messages.PickleStepArgument_PickleDocString,
) error

TheLoginModuleUnlinkClientEndpointForUserIDReturns mocks the return of the login module /platform_api/accounts_manager/unlink_client with the provided user_id.

func (*TestContext) TheRequestHeaderIs

func (ctx *TestContext) TheRequestHeaderIs(name, value string) error

func (*TestContext) TheResponseAtInJSONShouldBe added in v1.12.0

func (ctx *TestContext) TheResponseAtInJSONShouldBe(jsonPath string, wants *messages.PickleStepArgument_PickleDocString) error

TheResponseAtInJSONShouldBe checks that the response in JSON at a JSONPath matches.

func (*TestContext) TheResponseAtShouldBe added in v1.9.0

func (ctx *TestContext) TheResponseAtShouldBe(jsonPath string, wants *messages.PickleStepArgument_PickleTable) error

TheResponseAtShouldBe checks that the response at a JSONPath matches multiple values.

func (*TestContext) TheResponseAtShouldBeTheValue added in v1.9.0

func (ctx *TestContext) TheResponseAtShouldBeTheValue(jsonPath, value string) error

TheResponseAtShouldBeTheValue checks that the response at a JSONPath is a certain value.

func (*TestContext) TheResponseBodyShouldBe

func (ctx *TestContext) TheResponseBodyShouldBe(body *messages.PickleStepArgument_PickleDocString) (err error)

TheResponseBodyShouldBe checks that the response is the same as the one provided.

func (*TestContext) TheResponseBodyShouldBeJSON

func (ctx *TestContext) TheResponseBodyShouldBeJSON(body *messages.PickleStepArgument_PickleDocString) (err error)

func (*TestContext) TheResponseCodeShouldBe

func (ctx *TestContext) TheResponseCodeShouldBe(code int) error

func (*TestContext) TheResponseDecodedBodyShouldBeJSON

func (ctx *TestContext) TheResponseDecodedBodyShouldBeJSON(responseType string, body *messages.PickleStepArgument_PickleDocString) (err error)

func (*TestContext) TheResponseErrorMessageShouldContain

func (ctx *TestContext) TheResponseErrorMessageShouldContain(s string) (err error)

TheResponseErrorMessageShouldContain checks that the response contains the provided string.

func (*TestContext) TheResponseHeaderShouldBe

func (ctx *TestContext) TheResponseHeaderShouldBe(headerName, headerValue string) (err error)

TheResponseHeaderShouldBe checks that the response header matches the provided value.

func (*TestContext) TheResponseHeadersShouldBe

func (ctx *TestContext) TheResponseHeadersShouldBe(
	headerName string,
	headersValue *messages.PickleStepArgument_PickleDocString,
) (err error)

TheResponseHeadersShouldBe checks that the response header matches the multiline provided value.

func (*TestContext) TheResponseShouldBe

func (ctx *TestContext) TheResponseShouldBe(kind string) error

TheResponseShouldBe checks that the response status of the response is of the given kind.

func (*TestContext) TheTemplateConstantIsDocString

func (ctx *TestContext) TheTemplateConstantIsDocString(name string, value *messages.PickleStepArgument_PickleDocString) error

func (*TestContext) TheTemplateConstantIsString

func (ctx *TestContext) TheTemplateConstantIsString(name, value string) error

func (*TestContext) ThereAreTheFollowingGroups added in v1.9.0

func (ctx *TestContext) ThereAreTheFollowingGroups(groups *messages.PickleStepArgument_PickleTable) error

ThereAreTheFollowingGroups defines groups.

func (*TestContext) ThereAreTheFollowingItemPermissions added in v1.9.0

func (ctx *TestContext) ThereAreTheFollowingItemPermissions(itemPermissions *messages.PickleStepArgument_PickleTable) error

ThereAreTheFollowingItemPermissions defines item permissions.

func (*TestContext) ThereAreTheFollowingItemRelations added in v1.12.0

func (ctx *TestContext) ThereAreTheFollowingItemRelations(itemPermissions *messages.PickleStepArgument_PickleTable) error

ThereAreTheFollowingItemRelations defines item relations, in items_items table.

func (*TestContext) ThereAreTheFollowingItems added in v1.9.0

func (ctx *TestContext) ThereAreTheFollowingItems(items *messages.PickleStepArgument_PickleTable) error

ThereAreTheFollowingItems defines items.

func (*TestContext) ThereAreTheFollowingResults added in v1.9.0

func (ctx *TestContext) ThereAreTheFollowingResults(results *messages.PickleStepArgument_PickleTable) error

func (*TestContext) ThereAreTheFollowingTasks added in v1.9.0

func (ctx *TestContext) ThereAreTheFollowingTasks(tasks *messages.PickleStepArgument_PickleTable) error

ThereAreTheFollowingTasks defines item tasks.

func (*TestContext) ThereAreTheFollowingThreads added in v1.9.0

func (ctx *TestContext) ThereAreTheFollowingThreads(threads *messages.PickleStepArgument_PickleTable) error

ThereAreTheFollowingThreads create threads.

func (*TestContext) ThereAreTheFollowingUsers added in v1.9.0

func (ctx *TestContext) ThereAreTheFollowingUsers(users *messages.PickleStepArgument_PickleTable) error

ThereAreTheFollowingUsers defines users.

func (*TestContext) ThereIsAGroup added in v1.9.0

func (ctx *TestContext) ThereIsAGroup(group string) error

ThereIsAGroup creates a new group.

func (*TestContext) ThereIsAGroupWith added in v1.8.0

func (ctx *TestContext) ThereIsAGroupWith(parameters string) error

ThereIsAGroupWith creates a new group.

func (*TestContext) ThereIsAThreadWith added in v1.8.0

func (ctx *TestContext) ThereIsAThreadWith(parameters string) error

ThereIsAThreadWith creates a thread.

func (*TestContext) ThereIsAUser added in v1.9.0

func (ctx *TestContext) ThereIsAUser(name string) error

ThereIsAUser create a user.

func (*TestContext) ThereIsAUserWith added in v1.8.0

func (ctx *TestContext) ThereIsAUserWith(parameters string) error

ThereIsAUserWith creates a new user.

func (*TestContext) ThereIsNoThreadWith added in v1.8.0

func (ctx *TestContext) ThereIsNoThreadWith(parameters string) error

ThereIsNoThreadWith states that a given thread doesn't exist.

func (*TestContext) TimeIsFrozen

func (ctx *TestContext) TimeIsFrozen() error

TimeIsFrozen stubs time.Now to the current time.

func (*TestContext) TimeNow

func (ctx *TestContext) TimeNow(timeStr string) error

TimeNow stubs time.Now to the provided time.

func (*TestContext) UserCanGrantViewOnItemWithID added in v1.10.0

func (ctx *TestContext) UserCanGrantViewOnItemWithID(viewValue, user, item string) error

UserCanGrantViewOnItemWithID gives a user a can_grant_view permission on an item.

func (*TestContext) UserCanRequestHelpToOnItemWithID added in v1.10.0

func (ctx *TestContext) UserCanRequestHelpToOnItemWithID(canRequestHelpTo, user, item string) error

UserCanRequestHelpToOnItemWithID sets the can_request_help_to permission.

func (*TestContext) UserCanViewOnItemWithID added in v1.9.0

func (ctx *TestContext) UserCanViewOnItemWithID(viewValue, user, item string) error

UserCanViewOnItemWithID gives a user a can_view permission on an item.

func (*TestContext) UserCanWatchOnItemWithID added in v1.9.0

func (ctx *TestContext) UserCanWatchOnItemWithID(watchValue, user, item string) error

UserCanWatchOnItemWithID gives a user a "watch" permission on an item.

func (*TestContext) UserHaveValidatedItemWithID added in v1.9.0

func (ctx *TestContext) UserHaveValidatedItemWithID(user, item string) error

func (*TestContext) UserIsAManagerOfTheGroupAndCanGrantGroupAccess added in v1.10.0

func (ctx *TestContext) UserIsAManagerOfTheGroupAndCanGrantGroupAccess(user, group string) error

func (*TestContext) UserIsAManagerOfTheGroupAndCanWatchItsMembers added in v1.9.0

func (ctx *TestContext) UserIsAManagerOfTheGroupAndCanWatchItsMembers(user, group string) error

UserIsAManagerOfTheGroupAndCanWatchItsMembers sets the user as a manager of a group with can_watch permission.

func (*TestContext) UserIsAManagerOfTheGroupWith added in v1.9.0

func (ctx *TestContext) UserIsAManagerOfTheGroupWith(parameters string) error

UserIsAManagerOfTheGroupWith sets the current user as the manager of a group.

func (*TestContext) UserIsAMemberOfTheGroup added in v1.9.0

func (ctx *TestContext) UserIsAMemberOfTheGroup(user, group string) error

UserIsAMemberOfTheGroup puts a user in a group.

func (*TestContext) UserIsAMemberOfTheGroupWhoHasApprovedAccessToHisPersonalInfo added in v1.9.0

func (ctx *TestContext) UserIsAMemberOfTheGroupWhoHasApprovedAccessToHisPersonalInfo(user, group string) error

UserIsAMemberOfTheGroupWhoHasApprovedAccessToHisPersonalInfo puts a user in a group with approved access to his personnel info.

func (*TestContext) UserIsOwnerOfItemWithID added in v1.10.0

func (ctx *TestContext) UserIsOwnerOfItemWithID(isOwner, user, item string) error

UserIsOwnerOfItemWithID sets the is_owner permission.

func (*TestContext) UserSetPermissionExtendedOnItemWithID added in v1.12.0

func (ctx *TestContext) UserSetPermissionExtendedOnItemWithID(permission, value, user, item, sourceGroup, origin string) error

UserSetPermissionExtendedOnItemWithID gives a user a permission on an item with a specific source_group and origin.

func (*TestContext) UserSetPermissionOnItemWithID added in v1.10.0

func (ctx *TestContext) UserSetPermissionOnItemWithID(permission, value, user, item string) error

UserSetPermissionOnItemWithID gives a user a permission on an item.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL