2021-06-01 12:20:20 +00:00
|
|
|
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
|
2013-06-12 15:59:58 +00:00
|
|
|
|
2012-11-23 08:36:12 +00:00
|
|
|
class TestsController < ApplicationController
|
|
|
|
|
2021-02-10 08:11:02 +00:00
|
|
|
prepend_before_action -> { authentication_check_only }
|
|
|
|
|
2012-11-23 08:36:12 +00:00
|
|
|
# GET /test/wait
|
|
|
|
def wait
|
|
|
|
sleep params[:sec].to_i
|
2015-04-27 13:42:53 +00:00
|
|
|
result = { success: true }
|
|
|
|
render json: result
|
2012-11-23 08:36:12 +00:00
|
|
|
end
|
|
|
|
|
2020-02-12 14:50:18 +00:00
|
|
|
# GET /test/raised_exception
|
|
|
|
def error_raised_exception
|
|
|
|
exception = params.fetch(:exception, 'StandardError')
|
|
|
|
message = params.fetch(:message, 'no message provided')
|
2016-06-30 08:24:03 +00:00
|
|
|
|
2020-02-12 14:50:18 +00:00
|
|
|
raise exception.safe_constantize, message
|
2016-06-30 08:24:03 +00:00
|
|
|
end
|
|
|
|
|
2015-04-27 14:15:29 +00:00
|
|
|
end
|