Skip to content
CAI
Software that uses CAICheck a score

cucumber/cucumber-rails

68.9

Adequate · 20 September 2026

693

lines of production code

Ruby

primary language

1

measurement over time

CAI band scale
CAI lens gauges

What this system is

This system is the cucumber-rails gem, which integrates the Cucumber BDD framework with Ruby on Rails applications. It provides infrastructure for managing test environments, including database cleaning strategies, JavaScript driver configuration, and automated installation generators. The library ensures compatibility across multiple Rails versions by handling framework-specific adaptations for testing and execution.

How it got here

2009 — Rails 7.1 compatibility and cleanup

6 changes.

This period focused on updating the gem for modern Ruby and Rails versions, specifically adding support for Rails 7.1 and decoupling the library from a hard dependency on RSpec. The work also involved significant code cleanup by removing legacy generators and stub files, while establishing a new RSpec-based test configuration to ensure stability.

2010 — Rails 6-8 compatibility and test infrastructure

7 changes.

This period focused on updating Cucumber-Rails to support Rails versions 6 through 8, including handling HTML5 date inputs and CSRF-aware JavaScript emulation. The test infrastructure was significantly refactored to improve reliability, modularity, and debugging capabilities for modern Rails applications.

2011–2021 — Rails compatibility and code refactoring

5 changes.

The project expanded support for Rails versions 6.1 through 8.1 by introducing new Appraisal gemfiles and automated development dependency installation scripts. Concurrently, the database strategy logic was refactored into dedicated classes to improve maintainability, accompanied by comprehensive test coverage for these changes and the installation generator.

Features

Added installation scripts for geckodriver and Yarn

New executable scripts have been added to the bin directory to automate the setup of development dependencies. The install\_geckodriver.sh script downloads and installs geckodriver v0.33.0 for Linux, while install\_webpacker.sh configures the Yarn package manager repository and installs Yarn via apt.

bin · high confidence

New step definitions for testing cucumber-rails installation scenarios

Added a new step definition file (features/step\_definitions/cucumber\_rails\_steps.rb) that provides Gherkin steps for setting up test Rails applications with various cucumber-rails configurations. These steps allow tests to create new Rails apps, install cucumber-rails with or without database\_cleaner, handle apps without a database, remove specific gems from the Gemfile, and configure Selenium to run Firefox in headless mode or use select boxes for date fields.

_features/step\definitions · high confidence

Removals

Removal of legacy Cucumber and Feature generators

The Cucumber and Feature Rails generators have been removed from the codebase. This deletion eliminates the ability to automatically scaffold Cucumber integration files (such as \env.rb\, \webrat\_steps.rb\, and \cucumber.rake\) and the skeleton structure for new feature tests. Users will no longer be able to use the \script/generate cucumber\ or \script/generate feature\ commands to bootstrap these testing artifacts.

_rails\generators · high confidence

Removal of lib/cucumber-rails.rb stub file

The lib/cucumber-rails.rb file, which previously served as a minimal module stub with no functional code, has been removed from the library. This cleanup eliminates an empty entry point, streamlining the lib directory structure.

lib · high confidence

Behavioural changes

Add Rails 6+ Cucumber install generator

The \cucumber:install\ generator has been updated to support Rails 6 and later. It now configures Rails annotations to inspect Cucumber feature files in development and test environments, a change necessary because the previous annotation setup method (used in Rails 5 and earlier) is no longer available in Rails 6+. The generator also updates the default rake task name from \features\ to \cucumber\ and adjusts the database configuration logic to properly set up a \cucumber\ environment in \database.yml\.

lib/generators · high confidence

Deferred loading of Cucumber-rails components when required outside env.rb

Cucumber-rails now detects if it is required outside of the Cucumber env.rb file and, instead of failing or loading immediately, it prints a warning and defers the loading of Rails and Cucumber components until env.rb is actually executed. This change ensures that the library loads correctly even if the gem is required prematurely, while guiding users to configure their Gemfile with \require: false\ to avoid the warning.

lib/cucumber · high confidence

Expanded Rails compatibility via new Appraisal gemfiles

The library now supports testing and compatibility with Rails versions 6.1, 7.0, 7.1, 7.2, 8.0, and 8.1. This is achieved by adding new Appraisal gemfiles (rails\_6\_1.gemfile through rails\_8\_1.gemfile) that pin specific versions of railties, sqlite3, and other dependencies like capybara, factory\_bot, and cucumber to ensure stable test execution across these Rails releases.

gemfiles · high confidence

Rails 7.1 compatibility and decoupling from RSpec

The library now supports Rails 7.1 by adapting the ActionDispatch exception handling middleware to use the new symbol-based configuration instead of the deprecated boolean flag. It also removes the hard dependency on RSpec, allowing the framework to function in non-RSpec environments (such as Test::Unit or Minitest) by conditionally loading RSpec matchers only when available, and ensuring the World class inherits correctly from ActionDispatch::IntegrationTest without requiring RSpec-specific constants.

lib/cucumber/rails · high confidence

Refactor database strategies into dedicated classes

The database handling logic in \lib/cucumber/rails/database\ has been restructured so that each strategy (Deletion, Null, SharedConnection, Truncation) is now implemented in its own dedicated class file. This change improves code organization and maintainability by isolating the specific behaviors for different database cleaning modes, such as how connections are shared during JavaScript tests or how data is cleaned before and after scenarios.

lib/cucumber/rails/database · high confidence

Refactored Cucumber support infrastructure for Rails 8 compatibility

The test support layer has been restructured to improve reliability and extend compatibility to Rails 8. A new \CucumberRailsGemHelper\ module now manages dynamic gem installation, specifically adding SQLite 2.0 and Selenium 4.22 support for Rails 7.1+ and later versions. The \CucumberRailsSetupHelper\ streamlines test application generation by skipping unnecessary Rails components (such as Action Cable, Mailer, and JavaScript) to speed up setup. Additionally, \env.rb\ now configures Aruba with a 360-second exit timeout, and \hooks.rb\ ensures detailed stdout and stderr logging for failed scenarios to aid debugging.

features/support · high confidence

Reorganized database and mailer cleanup hooks with conditional execution

The database and mailer cleanup logic has been restructured into separate hook files (active\_record.rb, database\_cleaner.rb, mail.rb) to improve modularity. Database cleaning is now controlled by a new \autorun\_database\_cleaner\ flag, allowing users to disable automatic database cleaning via the \@no-database-cleaner\ tag or by setting the flag. The hooks now conditionally execute based on the presence of ActiveRecord and ActionMailer, and the database cleaner strategy is no longer overridden by the gem, deferring to the user's configuration. Additionally, a new \@allow-rescue\ hook has been added to temporarily enable \ActionController::Base.allow\_rescue\ for specific scenarios.

lib/cucumber/rails/hooks · high confidence

Support for Rails 7 HTML5 date inputs and CSRF-aware JS emulation

This update adds support for Rails 7 by detecting HTML5 date, time, and datetime input fields (type="date", "time", "datetime-local") in the \select\_dates\_and\_times\ helpers, falling back to legacy select-box logic only when these inputs are absent. It also introduces a new \javascript\_emulation\ module that enables the RackTest driver to simulate non-GET HTTP methods (DELETE, PUT, POST) via hidden form submissions, including automatic handling of Rails CSRF tokens to prevent session invalidation.

lib/cucumber/rails/capybara · high confidence

Test coverage

Added tests for Cucumber Rails database strategy handling; Added tests for the Cucumber install generator; Comprehensive feature tests for Cucumber-Rails integration and configuration; Initial RSpec test configuration for Rails integration.

Dependencies

Update gemspec dependencies and metadata for modern Ruby/Rails support

The cucumber-rails gemspec has been updated to require Ruby 3.2.0+ and Rails 6.1–8.x (via railties), with runtime dependencies pinned to Capybara 3.25–3.x and Cucumber 7–11.x. Development dependencies were refreshed to include Ammeter 1.1.7+, Appraisal 2.4.1–2.x, Aruba 2.2.x, DatabaseCleaner 2.1.x, RSpec 3.13.x, and RuboCop suite versions (rubocop 1.84.x, rubocop-rspec 3.9.x, rubocop-rails 2.34.x, rubocop-performance 1.26.x, rubocop-packaging 0.5.2, rubocop-rake 0.6.0), plus Yard 0.9.10.x. Metadata was added for bug tracker, changelog, documentation, mailing list, and source code URIs, and the license is now MIT.

(dependencies) · high confidence

Housekeeping

Version bump to 4.1.0

The gem version has been updated to 4.1.0, reflecting the recent release cycle and changes documented in the changelog.

(repo-wide) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Baseline

  • First survey — no prior run to compare against. CAI 69.

Lenses

  • Code Health 100
  • Architecture 69
  • Maturity 58
  • Readiness 91
  • Security 85

Changes since last survey

  • 300 commits — 274 feature/other, 26 fixes

By area

  • (root) — 121 commits
  • .github/workflows — 96 commits
  • (repo) — 45 commits
  • features/support — 6 commits
  • lib/cucumber — 6 commits
  • features/capybara_javascript_drivers.feature — 3 commits
  • lib/generators — 3 commits
  • .github/dependabot.yml — 2 commits
  • features/rerun_profile.feature — 2 commits
  • features/step_definitions — 2 commits
  • spec/cucumber — 2 commits
  • .github/FUNDING.yaml — 1 commit
  • .github/FUNDING.yml — 1 commit
  • .github/ISSUE_TEMPLATE.md — 1 commit
  • bin/install_geckodriver.sh — 1 commit
  • dev_tasks/yard — 1 commit
  • features/annotations.feature — 1 commit
  • features/database_cleaner.feature — 1 commit
  • features/emulate_javascript.feature — 1 commit
  • features/no_database.feature — 1 commit

Notable commits

  • fix: Auto/Manual fix to rubocop complaints
  • fix: Bugfix/fix factorybot ci issue (#583)
  • fix: Bugfix/post 3 1 1 release (#593)
  • fix: Bump rubocop gems a little bit and auto-fix offenses
  • fix: Bump rubocop rspec and rubocop to new majors Fix up all TODO offenses
  • fix: CHANGELOG.md: Fix link to changelog tool [ci skip]
  • fix: CHANGELOG: fix Markdown link
  • fix: CI fixes
  • fix: Fix broken CI badge after workflow rename (#614)
  • fix: Fix command to remove gem
  • fix: Fix missing rename
  • fix: Fix new rubocop offenses (#551)
  • fix: Fix path to VERISON
  • fix: Fix rest_api.feature expression
  • fix: Fix third test from same issue as first test Fix 2nd test having issue with new assertion on UTC timezone Rename some cukes
  • fix: Fix-up failing legacy tests
  • fix: Fix/workflow ci permutations (#570)
  • fix: Merge pull request #480 from cucumber/bugfix/javascript_tagged_scenarios
  • fix: Merge pull request #484 from Draiken/fix-action-mailer
  • fix: Merge pull request #495 from cucumber/fix-markdown-in-changelog
  • …and 280 more

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

cucumber/cucumber-rails was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 20 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 9eb560d642acd1891b0c4a55c95a4acbf7144ee1 — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-b51f968c9b10.