Check for token not being returned in JSON response (#91)

This avoid a potential nil pointer dereference since
JSON decoding can succeed with missing fields.
diff --git a/openstack/identity/v3/tokens/testing/requests_test.go b/openstack/identity/v3/tokens/testing/requests_test.go
index 195fa5a..27f3fdc 100644
--- a/openstack/identity/v3/tokens/testing/requests_test.go
+++ b/openstack/identity/v3/tokens/testing/requests_test.go
@@ -509,3 +509,24 @@
 		t.Errorf("Missing expected error from Revoke")
 	}
 }
+
+func TestNoTokenInResponse(t *testing.T) {
+	testhelper.SetupHTTP()
+	defer testhelper.TeardownHTTP()
+
+	client := gophercloud.ServiceClient{
+		ProviderClient: &gophercloud.ProviderClient{},
+		Endpoint:       testhelper.Endpoint(),
+	}
+
+	testhelper.Mux.HandleFunc("/auth/tokens", func(w http.ResponseWriter, r *http.Request) {
+		w.WriteHeader(http.StatusCreated)
+		fmt.Fprintf(w, `{}`)
+	})
+
+	options := tokens.AuthOptions{UserID: "me", Password: "squirrel!"}
+	_, err := tokens.Create(&client, &options).Extract()
+	if err == nil {
+		t.Error("Create succeeded with no token returned")
+	}
+}