Start with a failing test because that's how I roll
diff --git a/rackspace/lb/v1/nodes/requests_test.go b/rackspace/lb/v1/nodes/requests_test.go
index 003d347..a964af8 100644
--- a/rackspace/lb/v1/nodes/requests_test.go
+++ b/rackspace/lb/v1/nodes/requests_test.go
@@ -108,6 +108,38 @@
th.CheckDeepEquals(t, expected, actual)
}
+func TestCreateErr(t *testing.T) {
+ th.SetupHTTP()
+ defer th.TeardownHTTP()
+
+ mockCreateErrResponse(t, lbID)
+
+ opts := CreateOpts{
+ CreateOpt{
+ Address: "10.2.2.3",
+ Port: 80,
+ Condition: ENABLED,
+ Type: PRIMARY,
+ },
+ CreateOpt{
+ Address: "10.2.2.4",
+ Port: 81,
+ Condition: ENABLED,
+ Type: SECONDARY,
+ },
+ }
+
+ page := Create(client.ServiceClient(), lbID, opts)
+
+ actual, err := page.ExtractNodes()
+ if err == nil {
+ t.Fatal("Did not receive expected error from ExtractNodes")
+ }
+ if actual != nil {
+ t.Fatalf("Received non-nil result from failed ExtractNodes: %#v", actual)
+ }
+}
+
func TestBulkDelete(t *testing.T) {
th.SetupHTTP()
defer th.TeardownHTTP()