(t *testing.T)
| 91 | } |
| 92 | |
| 93 | func TestTokenHandler_NonPost(t *testing.T) { |
| 94 | config := &oauth1.Config{} |
| 95 | ts := httptest.NewServer(TokenHandler(config, testutils.AssertSuccessNotCalled(t), nil)) |
| 96 | resp, err := http.Get(ts.URL) |
| 97 | assert.Nil(t, err) |
| 98 | // assert that default (nil) failure handler returns a 405 Method Not Allowed |
| 99 | if assert.NotNil(t, resp) { |
| 100 | // TODO: change to 405 |
| 101 | assert.Equal(t, http.StatusBadRequest, resp.StatusCode) |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | func TestTokenHandler_NonPostPassesError(t *testing.T) { |
| 106 | config := &oauth1.Config{} |
nothing calls this directly
no test coverage detected