You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Release v1.6.0: Enhanced ERB template handling and dynamic ID support
- Added intelligent ERB template handling to preserve dynamic ID structure
- Fixed false positives for checkbox/radio groups with ERB-generated IDs
- Improved label matching for dynamic IDs from ERB templates
- Enhanced duplicate ID detection to exclude ERB placeholders
- Fixed missing accessible name detection for links with href='#'
- Refactored RSpec test file with proper assertions
- Updated documentation with ERB handling details
Copy file name to clipboardExpand all lines: CHANGELOG.md
+27Lines changed: 27 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,33 @@ All notable changes to this project will be documented in this file.
5
5
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
8
+
## [1.6.0] - 2024-12-XX
9
+
10
+
### Added
11
+
-**Intelligent ERB Template Handling**: Enhanced ERB extractor to preserve dynamic ID structure from ERB templates
12
+
-**Dynamic ID Support**: Static scanner now correctly handles checkbox/radio inputs with ERB-generated IDs (e.g., `collection_answers_<%= question.id %>_<%= option.id %>_`)
13
+
-**Label Matching for Dynamic IDs**: Form labels check now correctly matches labels to inputs with dynamic IDs by preserving ERB placeholder structure
14
+
-**Smart Duplicate ID Detection**: Duplicate ID check now excludes dynamic IDs with ERB placeholders, preventing false positives for checkbox/radio groups in loops
15
+
16
+
### Fixed
17
+
- Fixed false positive "Form input missing label [id: collection_answers]" for checkbox groups with dynamic IDs
18
+
- Fixed false positive "Duplicate ID 'collection_answers' found" when IDs contain ERB expressions
19
+
- Fixed missing accessible name detection for links with `href="#"` - now only flags links that truly lack accessible names (visible text, aria-label, or aria-labelledby)
20
+
- Improved `label_tag` helper conversion to handle string interpolation in ID arguments
21
+
- Enhanced raw HTML input element processing to preserve ERB structure in attributes
22
+
23
+
### Changed
24
+
-**ERB Extractor**: Now processes raw HTML elements with ERB in attributes before removing ERB tags, preserving dynamic ID structure
25
+
-**Form Labels Check**: Updated to handle ERB placeholders in IDs when checking for associated labels
26
+
-**Duplicate IDs Check**: Now filters out IDs containing `ERB_CONTENT` placeholders from duplicate detection
27
+
-**Interactive Elements Check**: Enhanced to correctly detect accessible names for links with `href="#"`, avoiding false positives
28
+
-**RSpec Test File**: Refactored `all_pages_accessibility_spec.rb` to extract formatting helper and add proper assertions that fail tests when errors are found
29
+
30
+
### Documentation
31
+
- Added comprehensive documentation on ERB template handling and dynamic ID processing
32
+
- Updated architecture documentation with details on how dynamic IDs are preserved
33
+
- Added examples and explanations for checkbox/radio groups with ERB-generated IDs
Copy file name to clipboardExpand all lines: docs_site/index.md
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ title: Home
7
7
8
8
**The RSpec + RuboCop of accessibility for Rails. Catch WCAG violations before they reach production.**
9
9
10
-
**Version:** 1.5.9
10
+
**Version:** 1.6.0
11
11
12
12
Rails Accessibility Testing is a comprehensive, opinionated but configurable gem that makes accessibility testing as natural as unit testing. It integrates seamlessly into your Rails workflow, catching accessibility issues as you code—not after deployment.
13
13
@@ -36,6 +36,10 @@ Rails Accessibility Testing fills a critical gap in the Rails testing ecosystem.
36
36
-**Continuous monitoring**: Watches for file changes and re-scans automatically
37
37
-**YAML configuration**: Fully configurable via `config/accessibility.yml`
38
38
-**Reuses existing checks**: Leverages all 11 accessibility checks via RuleEngine
39
+
-**Intelligent ERB handling**: Correctly processes dynamic IDs and ERB expressions
- Excludes dynamic IDs from duplicate checking (prevents false positives)
39
43
40
44
#### 🎯 Live Accessibility Scanner
41
45
-**Real-time scanning**: Automatically scans pages as you browse during development
@@ -140,15 +144,15 @@ This will:
140
144
141
145
The gem automatically runs **11 comprehensive accessibility checks**:
142
146
143
-
1. ✅ **Form Labels** - All form inputs have associated labels
147
+
1. ✅ **Form Labels** - All form inputs have associated labels (handles dynamic IDs from ERB templates)
144
148
2. ✅ **Image Alt Text** - All images have descriptive alt attributes
145
-
3. ✅ **Interactive Elements** - Buttons, links have accessible names (including links with images that have alt text)
149
+
3. ✅ **Interactive Elements** - Buttons, links have accessible names (including links with images that have alt text; correctly handles links with `href="#"`)
146
150
4. ✅ **Heading Hierarchy** - Proper h1-h6 structure (detects missing h1, multiple h1s, skipped levels, and h2+ without h1)
147
151
5. ✅ **Keyboard Accessibility** - All interactive elements keyboard accessible
148
152
6. ✅ **ARIA Landmarks** - Proper use of ARIA landmark roles
149
153
7. ✅ **Form Error Associations** - Errors linked to form fields
150
154
8. ✅ **Table Structure** - Tables have proper headers
151
-
9. ✅ **Duplicate IDs** - No duplicate ID attributes
155
+
9. ✅ **Duplicate IDs** - No duplicate ID attributes (intelligently handles dynamic IDs from ERB templates)
0 commit comments