diff --git a/app/controllers/devise_token_auth/passwords_controller.rb b/app/controllers/devise_token_auth/passwords_controller.rb index c59938c22..242a0032f 100644 --- a/app/controllers/devise_token_auth/passwords_controller.rb +++ b/app/controllers/devise_token_auth/passwords_controller.rb @@ -103,7 +103,7 @@ def edit config: params[:config] })) else - render_edit_error + raise ActionController::RoutingError.new('Not Found') end end @@ -179,12 +179,6 @@ def render_create_error }, status: @error_status end - def render_edit_error - render json: { - success: false - }, status: 404 - end - def render_update_error_unauthorized render json: { success: false, diff --git a/test/controllers/devise_token_auth/passwords_controller_test.rb b/test/controllers/devise_token_auth/passwords_controller_test.rb index 4dbe9ffce..461879c1c 100644 --- a/test/controllers/devise_token_auth/passwords_controller_test.rb +++ b/test/controllers/devise_token_auth/passwords_controller_test.rb @@ -123,13 +123,13 @@ class DeviseTokenAuth::PasswordsControllerTest < ActionController::TestCase end describe 'password reset link failure' do - test 'respone should return 404' do - xhr :get, :edit, { - reset_password_token: 'bogus', + test 'response should return 404' do + assert_raises(ActionController::RoutingError) { + xhr :get, :edit, { + reset_password_token: "bogus", redirect_url: @mail_redirect_url + } } - - assert_equal 404, response.status end end