func TestAppShowWithAppNotFound(t *testing.T) { aws := test.StubAws( test.DescribeStackNotFound("convox-test-bar"), test.DescribeStackNotFound("bar"), ) defer aws.Close() test.AssertStatus(t, 404, "GET", "http://convox/apps/bar", nil) }
func TestAppCreateWithAlreadyExistsUnbound(t *testing.T) { aws := test.StubAws( test.DescribeAppStackCycle("application"), ) defer aws.Close() val := url.Values{"name": []string{"application"}} body := test.AssertStatus(t, 403, "POST", "http://convox/apps", val) assert.Equal(t, "{\"error\":\"there is already a legacy app named application (running). We recommend you delete this app and create it again.\"}", body) }
func TestAppCreateWithRackName(t *testing.T) { aws := test.StubAws( test.DescribeAppStackCycle("foobar"), ) defer aws.Close() val := url.Values{"name": []string{"convox-test"}} body := test.AssertStatus(t, 403, "POST", "http://convox/apps", val) assert.Equal(t, "{\"error\":\"application name cannot match rack name (convox-test). Please choose a different name for your app.\"}", body) }
func TestAppCreateWithAlreadyExists(t *testing.T) { aws := test.StubAws( test.CreateAppStackExistsCycle("application"), test.DescribeAppStackCycle("application"), ) defer aws.Close() val := url.Values{"name": []string{"application"}} test.AssertStatus(t, 403, "POST", "http://convox/apps", val) }
func TestAppCreateWithAlreadyExists(t *testing.T) { aws := test.StubAws( test.DescribeStackNotFound("application"), test.CreateAppStackExistsCycle("convox-test-application"), test.DescribeAppStackCycle("convox-test-application"), ) defer aws.Close() val := url.Values{"name": []string{"application"}} body := test.AssertStatus(t, 403, "POST", "http://convox/apps", val) assert.Equal(t, "{\"error\":\"there is already an app named application (running)\"}", body) }
func TestAppDeleteWithAppNotFound(t *testing.T) { aws := test.StubAws(test.DescribeStackNotFound("bar")) defer aws.Close() test.AssertStatus(t, 404, "DELETE", "http://convox/apps/bar", nil) }