diff --git a/octopusdeploy/resource_user_role_test.go b/octopusdeploy/resource_user_role_test.go index 6fa59b13d..1db27e9b4 100644 --- a/octopusdeploy/resource_user_role_test.go +++ b/octopusdeploy/resource_user_role_test.go @@ -26,12 +26,36 @@ func TestAccUserRoleBasic(t *testing.T) { }) } +func TestAccUserRolePermissions(t *testing.T) { + localName := acctest.RandStringFromCharSet(20, acctest.CharSetAlpha) + name := acctest.RandStringFromCharSet(16, acctest.CharSetAlpha) + + resource.Test(t, resource.TestCase{ + CheckDestroy: testAccUserRoleCheckDestroy, + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testUserRolePermissions(localName, name), + }, + }, + }) +} + func testUserRoleMinimum(localName string, name string) string { return fmt.Sprintf(`resource "octopusdeploy_user_role" "%s" { name = "%s" }`, localName, name) } +func testUserRolePermissions(localName string, name string) string { + return fmt.Sprintf(`resource "octopusdeploy_user_role" "%s" { + name = "%s" + granted_space_permissions = ["AccountCreate"] + granted_system_permissions = ["SpaceView"] + }`, localName, name) +} + func testAccUserRoleCheckDestroy(s *terraform.State) error { client := testAccProvider.Meta().(*octopusdeploy.Client) for _, rs := range s.RootModule().Resources {