trabajo-afectivo/app/controllers/tests_controller.rb

23 lines
539 B
Ruby
Raw Normal View History

# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
2012-11-23 08:36:12 +00:00
class TestsController < ApplicationController
prepend_before_action -> { authentication_check_only }
2012-11-23 08:36:12 +00:00
# GET /test/wait
def wait
sleep params[:sec].to_i
result = { success: true }
render json: result
2012-11-23 08:36:12 +00:00
end
# GET /test/raised_exception
def error_raised_exception
exception = params.fetch(:exception, 'StandardError')
message = params.fetch(:message, 'no message provided')
raise exception.safe_constantize, message
end
end