New creates a new Fixture for the given admin service test fixture and (optional) user access token.
(t *testing.T, adm *testadmin.Fixture, token string)
| 20 | |
| 21 | // New creates a new Fixture for the given admin service test fixture and (optional) user access token. |
| 22 | func New(t *testing.T, adm *testadmin.Fixture, token string) *Fixture { |
| 23 | homeDir := t.TempDir() |
| 24 | dotRill := dotrill.New(homeDir) |
| 25 | require.NoError(t, dotRill.SetDefaultAdminURL(adm.ExternalURL())) |
| 26 | if token != "" { |
| 27 | require.NoError(t, dotRill.SetAccessToken(token)) |
| 28 | } |
| 29 | |
| 30 | return &Fixture{ |
| 31 | Admin: adm, |
| 32 | HomeDir: homeDir, |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | // NewWithUser is similar to New, but also creates a new user and authenticates the Fixture with a token for that user. |
| 37 | func NewWithUser(t *testing.T, adm *testadmin.Fixture) *Fixture { |