mirror of
https://github.com/ysoftdevs/terraform-provider-bitbucketserver.git
synced 2026-04-24 01:28:29 +02:00
Added tests for updating resources
This commit is contained in:
@@ -3,6 +3,7 @@ package bitbucket
|
||||
import (
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
@@ -36,6 +37,8 @@ func TestAccBitbucketResourceRepositoryPermissionsUser(t *testing.T) {
|
||||
}
|
||||
`, projectKey, projectKey)
|
||||
|
||||
configModified := strings.ReplaceAll(config, "REPO_WRITE", "REPO_READ")
|
||||
|
||||
resource.Test(t, resource.TestCase{
|
||||
PreCheck: func() { testAccPreCheck(t) },
|
||||
Providers: testAccProviders,
|
||||
@@ -50,6 +53,16 @@ func TestAccBitbucketResourceRepositoryPermissionsUser(t *testing.T) {
|
||||
resource.TestCheckResourceAttr("bitbucketserver_repository_permissions_user.test", "permission", "REPO_WRITE"),
|
||||
),
|
||||
},
|
||||
{
|
||||
Config: configModified,
|
||||
Check: resource.ComposeTestCheckFunc(
|
||||
resource.TestCheckResourceAttr("bitbucketserver_repository_permissions_user.test", "id", projectKey+"/test/mreynolds"),
|
||||
resource.TestCheckResourceAttr("bitbucketserver_repository_permissions_user.test", "project", projectKey),
|
||||
resource.TestCheckResourceAttr("bitbucketserver_repository_permissions_user.test", "repository", "test"),
|
||||
resource.TestCheckResourceAttr("bitbucketserver_repository_permissions_user.test", "user", "mreynolds"),
|
||||
resource.TestCheckResourceAttr("bitbucketserver_repository_permissions_user.test", "permission", "REPO_READ"),
|
||||
),
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user