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:
parent
9bdf1d2579
commit
a97a1c8f66
|
@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue