Skip to content

Commit

Permalink
#1381, Admin UI: do not render download links on the Api Logs page
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivanov-Anton authored and gigorok committed Dec 4, 2023
1 parent 1029843 commit aae9871
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/admin/logs/api_logs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 11 additions & 5 deletions spec/features/log/api_logs/index_api_logs_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit aae9871

Please sign in to comment.