(ts *ExternalTestSuite, u *url.URL, errorDescription string, errorType string, email string)
| 121 | } |
| 122 | |
| 123 | func assertAuthorizationFailure(ts *ExternalTestSuite, u *url.URL, errorDescription string, errorType string, email string) { |
| 124 | // ensure new sign ups error |
| 125 | v, err := url.ParseQuery(u.Fragment) |
| 126 | ts.Require().NoError(err) |
| 127 | ts.Require().Equal(errorDescription, v.Get("error_description")) |
| 128 | ts.Require().Equal(errorType, v.Get("error")) |
| 129 | |
| 130 | ts.Empty(v.Get("access_token")) |
| 131 | ts.Empty(v.Get("refresh_token")) |
| 132 | ts.Empty(v.Get("expires_in")) |
| 133 | ts.Empty(v.Get("token_type")) |
| 134 | |
| 135 | // ensure user is nil |
| 136 | user, err := models.FindUserByEmailAndAudience(ts.API.db, ts.instanceID, email, ts.Config.JWT.Aud) |
| 137 | ts.Require().Error(err, "User not found") |
| 138 | ts.Require().Nil(user) |
| 139 | } |
| 140 | |
| 141 | // TestSignupExternalUnsupported tests API /authorize for an unsupported external provider |
| 142 | func (ts *ExternalTestSuite) TestSignupExternalUnsupported() { |
no test coverage detected
searching dependent graphs…