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) }
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) }
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) }
// 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() } }