Add fixtures helper
diff --git a/testhelper/fixture/helper.go b/testhelper/fixture/helper.go
new file mode 100644
index 0000000..d54355d
--- /dev/null
+++ b/testhelper/fixture/helper.go
@@ -0,0 +1,31 @@
+package fixture
+
+import (
+ "fmt"
+ "net/http"
+ "testing"
+
+ th "github.com/rackspace/gophercloud/testhelper"
+ "github.com/rackspace/gophercloud/testhelper/client"
+)
+
+func SetupHandler(t *testing.T, url, method, requestBody, responseBody string, status int) {
+ th.Mux.HandleFunc(url, func(w http.ResponseWriter, r *http.Request) {
+ th.TestMethod(t, r, method)
+ th.TestHeader(t, r, "X-Auth-Token", client.TokenID)
+
+ if requestBody != "" {
+ th.TestJSONRequest(t, r, requestBody)
+ }
+
+ if responseBody != "" {
+ w.Header().Add("Content-Type", "application/json")
+ }
+
+ w.WriteHeader(status)
+
+ if responseBody != "" {
+ fmt.Fprintf(w, responseBody)
+ }
+ })
+}