Skip to content

Commit 1766410

Browse files
authored
Merge pull request #70 from pub-solar/fix-tests
Add missing test for email attribute
2 parents 4d672e8 + ab3fddd commit 1766410

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

hostingde/record_resource_test.go

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ resource "hostingde_record" "test" {
3131
// Verify type attribute.
3232
resource.TestCheckResourceAttr("hostingde_record.test", "type", "CNAME"),
3333
// Verify email attribute.
34+
resource.TestCheckResourceAttr("hostingde_zone.test", "email", "hostmaster@example2.test"),
35+
// Verify content attribute.
3436
resource.TestCheckResourceAttr("hostingde_record.test", "content", "www.example.com"),
3537
// Verify dynamic values have any value set in the state.
3638
resource.TestCheckResourceAttrSet("hostingde_record.test", "id"),
@@ -45,12 +47,12 @@ resource "hostingde_zone" "test" {
4547
type = "NATIVE"
4648
email = "hostmaster@example2.test"
4749
}
48-
resource "hostingde_record" "test_mx2" {
50+
resource "hostingde_record" "test_mx" {
4951
zone_id = hostingde_zone.test.id
5052
name = "example2.test"
5153
type = "MX"
52-
content = "mail2.example2.test"
53-
priority = 20
54+
content = "mail.example2.test"
55+
priority = 10
5456
}
5557
`,
5658
Check: resource.ComposeAggregateTestCheckFunc(
@@ -60,20 +62,12 @@ resource "hostingde_record" "test_mx2" {
6062
resource.TestCheckResourceAttr("hostingde_record.test_mx", "type", "MX"),
6163
// Verify priority attribute.
6264
resource.TestCheckResourceAttr("hostingde_record.test_mx", "priority", "10"),
63-
// Verify email attribute.
65+
// Verify content attribute.
6466
resource.TestCheckResourceAttr("hostingde_record.test_mx", "content", "mail.example2.test"),
65-
// Verify dynamic values have any value set in the state.
66-
resource.TestCheckResourceAttrSet("hostingde_record.test_mx", "id"),
67-
// Verify name attribute.
68-
resource.TestCheckResourceAttr("hostingde_record.test_mx2", "name", "example2.test"),
69-
// Verify type attribute.
70-
resource.TestCheckResourceAttr("hostingde_record.test_mx2", "type", "MX"),
71-
// Verify priority attribute.
72-
resource.TestCheckResourceAttr("hostingde_record.test_mx2", "priority", "20"),
7367
// Verify email attribute.
74-
resource.TestCheckResourceAttr("hostingde_record.test_mx2", "content", "mail2.example2.test"),
68+
resource.TestCheckResourceAttr("hostingde_zone.test", "email", "hostmaster@example2.test"),
7569
// Verify dynamic values have any value set in the state.
76-
resource.TestCheckResourceAttrSet("hostingde_record.test_mx2", "id"),
70+
resource.TestCheckResourceAttrSet("hostingde_record.test_mx", "id"),
7771
),
7872
},
7973
// Create and read TXT testing
@@ -97,7 +91,7 @@ resource "hostingde_record" "test_dkim" {
9791
resource.TestCheckResourceAttr("hostingde_record.test_dkim", "name", "default._domainkey.example2.test"),
9892
// Verify type attribute.
9993
resource.TestCheckResourceAttr("hostingde_record.test_dkim", "type", "TXT"),
100-
// Verify email attribute.
94+
// Verify content attribute.
10195
resource.TestCheckResourceAttr("hostingde_record.test_dkim", "content", "v=DKIM1;k=rsa;p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyla9hW3TvoXvZQxwzaJ4SZ9ict1HU3E6+FwLWniGe6TiPtcYrjTIsiudQb8tltibOXiS+qqbxzI+quI3aGU6osy2rIv0eWo8+oOOqOD9pERftc/aqe51cXuv4kPqwvpXEBwrXFWVM+VxivEubUJ7eKkFyXJpelv0LslXv/MmYbUyed6dF+reOGZCsvnbiRv74qdxbAL/25j62E8WrnxzJwhUtx/JhdBOjsHBvuw9hy6rZsVJL9eXayWyGRV6qmsLRzsRSBs+mDrgmKk4dugADd11+A03ics3i8hplRoWDkqnNKz1qy4f5TsV6v9283IANrAzRfHwX8EvNiFsBz+ZCQIDAQAB"),
10296
// Verify dynamic values have any value set in the state.
10397
resource.TestCheckResourceAttrSet("hostingde_record.test_dkim", "id"),
@@ -148,7 +142,7 @@ resource "hostingde_record" "test_mx" {
148142
Check: resource.ComposeAggregateTestCheckFunc(
149143
// Verify content attribute.
150144
resource.TestCheckResourceAttr("hostingde_record.test_mx", "content", "mail2.example2.test"),
151-
// Verify content attribute.
145+
// Verify priority attribute.
152146
resource.TestCheckResourceAttr("hostingde_record.test_mx", "priority", "20"),
153147
),
154148
},

0 commit comments

Comments
 (0)