From aae987145087b40c0891f82beb4a29cf16c7202a Mon Sep 17 00:00:00 2001 From: Ivanov-Anton Date: Mon, 4 Dec 2023 12:39:51 +0200 Subject: [PATCH] #1381, Admin UI: do not render download links on the Api Logs page --- app/admin/logs/api_logs.rb | 2 +- .../features/log/api_logs/index_api_logs_spec.rb | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/app/admin/logs/api_logs.rb b/app/admin/logs/api_logs.rb index 8fb79e449..c96eaa9e7 100644 --- a/app/admin/logs/api_logs.rb +++ b/app/admin/logs/api_logs.rb @@ -39,7 +39,7 @@ def find_resource filter :response_headers filter :remote_ip_eq_inet, as: :string, label: 'Remote IP' - index do + index download_links: false do id_column column :created_at column :status diff --git a/spec/features/log/api_logs/index_api_logs_spec.rb b/spec/features/log/api_logs/index_api_logs_spec.rb index ae66c64c6..a6b1dc88c 100644 --- a/spec/features/log/api_logs/index_api_logs_spec.rb +++ b/spec/features/log/api_logs/index_api_logs_spec.rb @@ -3,11 +3,17 @@ RSpec.describe 'Index Log Api Logs', type: :feature do include_context :login_as_admin - it 'n+1 checks' do - api_logs = create_list(:api_log, 2) - visit api_logs_path - api_logs.each do |api_log| - expect(page).to have_css('.resource_id_link', text: api_log.id) + context 'when visit index page with two API Logs' do + let!(:api_log_first) { FactoryBot.create(:api_log) } + let!(:api_log_second) { FactoryBot.create(:api_log) } + + before { visit api_logs_path } + + it 'should render index page properly' do + expect(page).to have_table_row count: 2 + expect(page).to have_table_cell column: 'Id', exact_text: api_log_first.id + expect(page).to have_table_cell column: 'Id', exact_text: api_log_second.id + expect(page).not_to have_link 'CSV' end end