|
@@ -147,6 +147,18 @@ class MonitoringControllerTest < ActionDispatch::IntegrationTest
|
|
|
|
|
|
test '03 monitoring with correct token' do
|
|
|
|
|
|
+
|
|
|
+ string = ''
|
|
|
+ 10.times do
|
|
|
+ string += 'Some Text Some Text Some Text Some Text Some Text Some Text Some Text Some Text'
|
|
|
+ end
|
|
|
+ Store.add(
|
|
|
+ object: 'User',
|
|
|
+ o_id: 1,
|
|
|
+ data: string,
|
|
|
+ filename: 'filename.txt',
|
|
|
+ )
|
|
|
+
|
|
|
|
|
|
get "/api/v1/monitoring/health_check?token=#{@token}", params: {}, headers: @headers
|
|
|
assert_response(200)
|
|
@@ -169,6 +181,15 @@ class MonitoringControllerTest < ActionDispatch::IntegrationTest
|
|
|
assert(result.key?('counts'))
|
|
|
assert(result.key?('last_created_at'))
|
|
|
|
|
|
+ if ActiveRecord::Base.connection_config[:adapter] == 'postgresql'
|
|
|
+ assert(result['storage'])
|
|
|
+ assert(result['storage'].key?('kB'))
|
|
|
+ assert(result['storage'].key?('MB'))
|
|
|
+ assert(result['storage'].key?('GB'))
|
|
|
+ else
|
|
|
+ assert_not(result['storage'])
|
|
|
+ end
|
|
|
+
|
|
|
|
|
|
post '/api/v1/monitoring/token', params: { token: @token }.to_json, headers: @headers
|
|
|
assert_response(401)
|