Skip to content

Commit

Permalink
r/aws_iam_user: Add path update test
Browse files Browse the repository at this point in the history
  • Loading branch information
bflad committed Jan 16, 2018
1 parent 306bfb7 commit e42beb2
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions aws/resource_aws_iam_user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,34 @@ func TestAccAWSUser_nameChange(t *testing.T) {
})
}

func TestAccAWSUser_pathChange(t *testing.T) {
var conf iam.GetUserOutput

name := fmt.Sprintf("test-user-%d", acctest.RandInt())
path1 := "/"
path2 := "/updated/"

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSUserDestroy,
Steps: []resource.TestStep{
{
Config: testAccAWSUserConfig(name, path1),
Check: resource.ComposeTestCheckFunc(
testAccCheckAWSUserExists("aws_iam_user.user", &conf),
),
},
{
Config: testAccAWSUserConfig(name, path2),
Check: resource.ComposeTestCheckFunc(
testAccCheckAWSUserExists("aws_iam_user.user", &conf),
),
},
},
})
}

func testAccCheckAWSUserDestroy(s *terraform.State) error {
iamconn := testAccProvider.Meta().(*AWSClient).iamconn

Expand Down

0 comments on commit e42beb2

Please sign in to comment.