Ejemplo n.º 1
0
/* NOTE: the S3 stuff f***s up b.c the client ries to prepend the
bucket name to the ephermeral host, so you get `app-XXX.127.0.0.1`
*/
func TestAppDelete(t *testing.T) {
	aws := test.StubAws(
		test.DescribeAppStackCycle("convox-test-bar"),
		test.DeleteStackCycle("convox-test-bar"),
	)
	defer aws.Close()

	body := test.HTTPBody("DELETE", "http://convox/apps/bar", nil)

	var resp map[string]bool
	err := json.Unmarshal([]byte(body), &resp)

	if assert.Nil(t, err) {
		assert.Equal(t, true, resp["success"])
	}
}
Ejemplo n.º 2
0
/* NOTE: the S3 stuff f***s up b.c the client ries to prepend the
bucket name to the ephermeral host, so you get `app-XXX.127.0.0.1`
*/
func TestAppDelete(t *testing.T) {
	aws := test.StubAws(
		test.DescribeAppStackCycle("convox-test-bar"),
		test.DeleteStackCycle("convox-test-bar"),
	)
	defer aws.Close()

	// setup expectations on current provider
	models.TestProvider.On("AppDelete", "bar").Return(nil)

	body := test.HTTPBody("DELETE", "http://convox/apps/bar", nil)

	var resp map[string]bool
	err := json.Unmarshal([]byte(body), &resp)

	if assert.Nil(t, err) {
		assert.Equal(t, true, resp["success"])
	}
}