Validating API Token Management Implementation in DocuSeal
This test suite validates API settings functionality in the DocuSeal application, focusing on user authentication and token management. It ensures proper display and security of API access tokens through system-level testing.
Test Coverage Overview
Implementation Analysis
Technical Details
Best Practices Demonstrated
docusealco/docuseal
spec/system/api_settings_spec.rb
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe 'API Settings' do
let!(:account) { create(:account) }
let!(:user) { create(:user, account:) }
before do
sign_in(user)
visit settings_api_index_path
end
it 'shows verify signed PDF page' do
expect(page).to have_content('API')
token = user.access_token.token
expect(page).to have_field('X-Auth-Token', with: token.sub(token[5..], '*' * token[5..].size))
end
end