Skip to content

Commit

Permalink
fun times
Browse files Browse the repository at this point in the history
  • Loading branch information
malnick committed Aug 27, 2020
1 parent edd30c1 commit 8c70e92
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
7 changes: 5 additions & 2 deletions internal/provider/resource_project_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ func TestResourceDataToProject(t *testing.T) {
projectDescriptionKey: "desc",
},
expected: &scopes.Scope{
Scope: &scopes.ScopeInfo{},
Name: "name",
Description: "desc",
},
Expand All @@ -151,7 +152,8 @@ func TestResourceDataToProject(t *testing.T) {
projectNameKey: "name",
},
expected: &scopes.Scope{
Name: "name",
Scope: &scopes.ScopeInfo{},
Name: "name",
},
},
{
Expand All @@ -160,13 +162,14 @@ func TestResourceDataToProject(t *testing.T) {
projectDescriptionKey: "desc",
},
expected: &scopes.Scope{
Scope: &scopes.ScopeInfo{},
Description: "desc",
},
},
{
name: "Not populated",
rData: map[string]interface{}{},
expected: &scopes.Scope{},
expected: &scopes.Scope{Scope: &scopes.ScopeInfo{}},
},
}
for _, tc := range testCases {
Expand Down
12 changes: 6 additions & 6 deletions internal/provider/resource_user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@ const (
var (
orgUser = fmt.Sprintf(`
resource "boundary_user" "foo" {
name = "test"
name = "test"
description = "%s"
scope_id = boundary_organization.foo.id
}`, fooUserDescription)

orgUserUpdate = fmt.Sprintf(`
resource "boundary_user" "foo" {
name = "test"
name = "test"
description = "%s"
scope_id = boundary_organization.foo.id
}`, fooUserDescriptionUpdate)
)

Expand All @@ -42,22 +44,20 @@ func TestAccUser(t *testing.T) {
Steps: []resource.TestStep{
{
// test create
Config: testConfig(url, orgUser),
Config: testConfig(url, fooOrg, orgUser),
Check: resource.ComposeTestCheckFunc(
testAccCheckUserResourceExists("boundary_user.foo"),
resource.TestCheckResourceAttr("boundary_user.foo", userDescriptionKey, fooUserDescription),
resource.TestCheckResourceAttr("boundary_user.foo", userNameKey, "test"),
resource.TestCheckResourceAttr("boundary_user.foo", userScopeIDKey, tcOrg),
),
},
{
// test update description
Config: testConfig(url, orgUserUpdate),
Config: testConfig(url, fooOrg, orgUserUpdate),
Check: resource.ComposeTestCheckFunc(
testAccCheckUserResourceExists("boundary_user.foo"),
resource.TestCheckResourceAttr("boundary_user.foo", userDescriptionKey, fooUserDescriptionUpdate),
resource.TestCheckResourceAttr("boundary_user.foo", userNameKey, "test"),
resource.TestCheckResourceAttr("boundary_user.foo", userScopeIDKey, tcOrg),
),
},
},
Expand Down

0 comments on commit 8c70e92

Please sign in to comment.