Added tests for updating resources

This commit is contained in:
Gavin Bunney
2019-10-18 11:17:08 -07:00
parent ec0c3ad91b
commit e9b753d854
12 changed files with 156 additions and 15 deletions
@@ -3,6 +3,7 @@ package bitbucket
import (
"fmt"
"math/rand"
"strings"
"testing"
"time"
@@ -30,6 +31,8 @@ func TestAccBitbucketResourceProjectPermissionsUser(t *testing.T) {
}
`, projectKey)
configModified := strings.ReplaceAll(config, "PROJECT_READ", "PROJECT_WRITE")
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
@@ -43,6 +46,15 @@ func TestAccBitbucketResourceProjectPermissionsUser(t *testing.T) {
resource.TestCheckResourceAttr("bitbucketserver_project_permissions_user.test", "permission", "PROJECT_READ"),
),
},
{
Config: configModified,
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("bitbucketserver_project_permissions_user.test", "id", projectKey+"/mreynolds"),
resource.TestCheckResourceAttr("bitbucketserver_project_permissions_user.test", "project", projectKey),
resource.TestCheckResourceAttr("bitbucketserver_project_permissions_user.test", "user", "mreynolds"),
resource.TestCheckResourceAttr("bitbucketserver_project_permissions_user.test", "permission", "PROJECT_WRITE"),
),
},
},
})
}