:redirect_uri => application.redirect_uri,
:response_type => "code",
:scope => "write_api")
- assert_response :redirect
assert_redirected_to login_path(:referer => oauth_authorization_path(:client_id => application.uid,
:redirect_uri => application.redirect_uri,
:response_type => "code",
:redirect_uri => application.redirect_uri,
:response_type => "code",
:scope => "write_api")
- assert_response :redirect
assert_redirected_to login_path(:referer => oauth_authorization_path(:client_id => application.uid,
:redirect_uri => application.redirect_uri,
:response_type => "code",
:redirect_uri => "https://bad.example.com/",
:response_type => "code",
:scope => "write_api")
- assert_response :success
+ assert_response :bad_request
assert_template "oauth2_authorizations/error"
assert_select "p", "The requested redirect uri is malformed or doesn't match client redirect URI."
end
:redirect_uri => application.redirect_uri,
:response_type => "code",
:scope => "bad_scope")
- assert_response :success
+ assert_response :bad_request
assert_template "oauth2_authorizations/error"
assert_select "p", "The requested scope is invalid, unknown, or malformed."
:redirect_uri => application.redirect_uri,
:response_type => "code",
:scope => "write_prefs")
- assert_response :success
+ assert_response :bad_request
assert_template "oauth2_authorizations/error"
assert_select "p", "The requested scope is invalid, unknown, or malformed."
end
:redirect_uri => application.redirect_uri,
:response_type => "code",
:scope => "write_api")
- assert_response :redirect
assert_redirected_to(/^#{Regexp.escape(application.redirect_uri)}\?code=/)
end
:redirect_uri => application.redirect_uri,
:response_type => "code",
:scope => "write_api")
- assert_response :redirect
assert_redirected_to(/^#{Regexp.escape(application.redirect_uri)}\?error=access_denied/)
end