Back to Repositories

Validating Personalization Settings Workflow in DocuSeal

This test suite validates the personalization settings functionality in DocuSeal, focusing on email templates and company branding features. The tests ensure proper display and accessibility of key personalization options through system-level testing.

Test Coverage Overview

The test suite covers essential personalization settings verification, ensuring all major customization options are accessible and properly displayed.

  • Validates presence of email template sections
  • Verifies company logo settings visibility
  • Tests user authentication and access to settings
  • Confirms proper routing to personalization page

Implementation Analysis

The implementation utilizes RSpec’s system testing capabilities with page object interactions and expectations. The approach leverages factory-based test data setup and authentication helpers.

  • Uses RSpec describe and it blocks for clear test organization
  • Implements before hooks for test setup
  • Employs factory_bot for test data generation
  • Utilizes Capybara page interactions

Technical Details

  • Testing Framework: RSpec
  • Test Type: System Test
  • Dependencies: Rails Helper, Capybara
  • Data Setup: FactoryBot
  • Authentication: Custom sign_in helper
  • Page Navigation: visit helper

Best Practices Demonstrated

The test follows established testing best practices with clear separation of concerns and efficient test setup.

  • Isolated test environment setup
  • Descriptive test naming
  • Focused test scope
  • Proper use of let blocks for test data
  • Clear expectations and assertions

docusealco/docuseal

spec/system/personalization_spec.rb

            
# frozen_string_literal: true

require 'rails_helper'

RSpec.describe 'Personalization' do
  let!(:account) { create(:account) }
  let!(:user) { create(:user, account:) }

  before do
    sign_in(user)
    visit settings_personalization_path
  end

  it 'shows the personalization page' do
    expect(page).to have_content('Email Templates')
    expect(page).to have_content('Signature Request Email')
    expect(page).to have_content('Completed Notification Email')
    expect(page).to have_content('Documents Copy Email')
    expect(page).to have_content('Company Logo')
  end
end