feature/shared file systems: create share (#119)
* sfs/add url for create
* sfs/results: add share type and result type
* sfs/requests: add CreateOpts and Create method
* sfs/tests: add tests for creating a share
* sfs/shares: fixes according to comments
* sfs/create: fix Metadata field naming in Share
diff --git a/openstack/sharedfilesystems/v2/shares/testing/request_test.go b/openstack/sharedfilesystems/v2/shares/testing/request_test.go
new file mode 100644
index 0000000..6d69201
--- /dev/null
+++ b/openstack/sharedfilesystems/v2/shares/testing/request_test.go
@@ -0,0 +1,23 @@
+package testing
+
+import (
+ "github.com/gophercloud/gophercloud/openstack/sharedfilesystems/v2/shares"
+ th "github.com/gophercloud/gophercloud/testhelper"
+ "github.com/gophercloud/gophercloud/testhelper/client"
+ "testing"
+)
+
+func TestCreate(t *testing.T) {
+ th.SetupHTTP()
+ defer th.TeardownHTTP()
+
+ MockCreateResponse(t)
+
+ options := &shares.CreateOpts{Size: 1, Name: "my_test_share", ShareProto: "NFS"}
+ n, err := shares.Create(client.ServiceClient(), options).Extract()
+
+ th.AssertNoErr(t, err)
+ th.AssertEquals(t, n.Name, "my_test_share")
+ th.AssertEquals(t, n.Size, 1)
+ th.AssertEquals(t, n.ShareProto, "NFS")
+}