forked from hashicorp/go-tfe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin_setting_twilio_integration_test.go
52 lines (37 loc) · 1.17 KB
/
admin_setting_twilio_integration_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package tfe
import (
"context"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestAdminSettings_Twilio_Read(t *testing.T) {
skipUnlessEnterprise(t)
client := testClient(t)
ctx := context.Background()
twilioSettings, err := client.Admin.Settings.Twilio.Read(ctx)
require.NoError(t, err)
assert.Equal(t, "twilio", twilioSettings.ID)
assert.NotNil(t, twilioSettings.Enabled)
assert.NotNil(t, twilioSettings.AccountSid)
assert.NotNil(t, twilioSettings.FromNumber)
}
func TestAdminSettings_Twilio_Update(t *testing.T) {
skipUnlessEnterprise(t)
client := testClient(t)
ctx := context.Background()
twilioSettings, err := client.Admin.Settings.Twilio.Update(ctx, AdminTwilioSettingsUpdateOptions{
Enabled: Bool(false),
})
require.NoError(t, err)
assert.Equal(t, false, twilioSettings.Enabled)
}
func TestAdminSettings_Twilio_Verify(t *testing.T) {
skipUnlessEnterprise(t)
client := testClient(t)
ctx := context.Background()
err := client.Admin.Settings.Twilio.Verify(ctx, AdminTwilioSettingsVerifyOptions{})
assert.Equal(t, err, ErrRequiredTestNumber)
}