cloud.MockClient: Use Contains() to implement Search

The TFC API doesn't behave this way; a search term just signals the
substring was found within the name.
This commit is contained in:
Chris Arcand 2021-09-14 15:22:33 -05:00
parent 9bdf1d2579
commit a97a1c8f66
1 changed files with 1 additions and 1 deletions

View File

@ -1103,7 +1103,7 @@ func (m *MockWorkspaces) List(ctx context.Context, organization string, options
// Get all the workspaces that match the prefix. // Get all the workspaces that match the prefix.
var ws []*tfe.Workspace var ws []*tfe.Workspace
for _, w := range m.workspaceIDs { for _, w := range m.workspaceIDs {
if strings.HasPrefix(w.Name, prefix) { if strings.Contains(w.Name, prefix) {
ws = append(ws, w) ws = append(ws, w)
} }
} }