Refactor to use new handler setup
diff --git a/openstack/db/v1/databases/requests_test.go b/openstack/db/v1/databases/requests_test.go
index 6f5edb6..11bf9c8 100644
--- a/openstack/db/v1/databases/requests_test.go
+++ b/openstack/db/v1/databases/requests_test.go
@@ -6,15 +6,20 @@
"github.com/rackspace/gophercloud/pagination"
th "github.com/rackspace/gophercloud/testhelper"
fake "github.com/rackspace/gophercloud/testhelper/client"
+ "github.com/rackspace/gophercloud/testhelper/fixture"
)
const instanceID = "{instanceID}"
+var (
+ resURL = "/instances/" + instanceID + "/databases"
+)
+
func TestCreate(t *testing.T) {
th.SetupHTTP()
defer th.TeardownHTTP()
- HandleCreateDBSuccessfully(t, instanceID)
+ fixture.SetupHandler(t, resURL, "POST", createDBsReq, "", 202)
opts := BatchCreateOpts{
CreateOpts{Name: "testingdb", CharSet: "utf8", Collate: "utf8_general_ci"},
@@ -29,7 +34,7 @@
th.SetupHTTP()
defer th.TeardownHTTP()
- HandleListDBsSuccessfully(t, instanceID)
+ fixture.SetupHandler(t, resURL, "GET", "", listDBsResp, 200)
expectedDBs := []Database{
Database{Name: "anotherexampledb"},
@@ -64,7 +69,7 @@
th.SetupHTTP()
defer th.TeardownHTTP()
- HandleDeleteDBSuccessfully(t, instanceID, "{dbName}")
+ fixture.SetupHandler(t, resURL+"/{dbName}", "DELETE", "", "", 202)
err := Delete(fake.ServiceClient(), instanceID, "{dbName}").ExtractErr()
th.AssertNoErr(t, err)