예제 #1
0
파일: api_test.go 프로젝트: harryross/rack
func TestNoPassword(t *testing.T) {
	aws := stubAws(DescribeConvoxStackCycle("convox-test"))
	defer aws.Close()
	defer os.Setenv("RACK", os.Getenv("RACK"))

	os.Setenv("RACK", "convox-test")

	assert.HTTPSuccess(t, controllers.HandlerFunc, "GET", "http://convox/system", nil)
}
예제 #2
0
파일: api_test.go 프로젝트: gmelika/rack
func TestNoPassword(t *testing.T) {
	models.TestProvider.On("SystemGet").Return(nil, nil)

	aws := test.StubAws(test.DescribeConvoxStackCycle("convox-test"))
	defer aws.Close()
	defer os.Setenv("RACK", os.Getenv("RACK"))

	os.Setenv("RACK", "convox-test")

	assert.HTTPSuccess(t, controllers.HandlerFunc, "GET", "http://convox/system", nil)
}
예제 #3
0
파일: api_test.go 프로젝트: cleblanc87/rack
func TestNoPassword(t *testing.T) {
	// set current provider
	testProvider := &provider.TestProviderRunner{}
	provider.CurrentProvider = testProvider
	defer func() {
		//TODO: remove: as we arent updating all tests we need tos et current provider back to a
		//clean default one (I miss rspec before)
		provider.CurrentProvider = new(provider.TestProviderRunner)
	}()
	// setup expectations on current provider
	testProvider.On("SystemGet").Return(nil, nil)

	aws := test.StubAws(test.DescribeConvoxStackCycle("convox-test"))
	defer aws.Close()
	defer os.Setenv("RACK", os.Getenv("RACK"))

	os.Setenv("RACK", "convox-test")

	assert.HTTPSuccess(t, controllers.HandlerFunc, "GET", "http://convox/system", nil)
}
예제 #4
0
파일: require.go 프로젝트: stretchr/testify
// HTTPSuccess asserts that a specified handler returns a success status code.
//
//  assert.HTTPSuccess(t, myHandler, "POST", "http://www.google.com", nil)
//
// Returns whether the assertion was successful (true) or not (false).
func HTTPSuccess(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values) {
	if !assert.HTTPSuccess(t, handler, method, url, values) {
		t.FailNow()
	}
}