Testing Paperclip File Upload Field Implementation in rails_admin
This test suite validates the Paperclip file upload functionality within the Rails Admin interface. It focuses on ensuring proper field rendering and configuration for file attachments, specifically testing the avatar upload capability in the user model.
Test Coverage Overview
Implementation Analysis
Technical Details
Best Practices Demonstrated
railsadminteam/rails_admin
spec/integration/fields/paperclip_spec.rb
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'Paperclip field', type: :request do
subject { page }
it 'shows a file upload field' do
RailsAdmin.config User do
edit do
field :avatar
end
end
visit new_path(model_name: 'user')
is_expected.to have_selector('input#user_avatar')
end
end