dbconsole in Rails 3 requires the environment as the first argument
Rails 3 dbconsole misreads -p test and opens the development database unless the environment is passed first.
FactoryBot: Traits for enums
Enum values can become FactoryBot traits automatically, reducing manual trait definitions and making new roles or states available in tests with less setup.
ActionView::Template::Error (dump format error for symbol(0x6d))
Selenium tests can fail with ActionView::Template::Error and a dump format error for a symbol, often caused by stale cached files in tmp/cache.
MySQL: How to dump single tables instead of a complete database
Need production or staging data for migration tests without a full database export; mysqldump can dump only selected tables when a complete dump is too large.
Jasmine: Test that an object is an instance of a given class
Verify that a value was created by a specific constructor in Jasmine with jasmine.any(Klass) instead of direct instance checks.
Cucumber step to test whether a select field is sorted
Custom Cucumber step for checking that a dropdown’s options are in order, with a Capybara matcher for natural sorting.
How to test resource_controller hooks
Testing resource_controller callbacks directly avoids triggering the action path and verifies hook behavior in controller specs.
Capybara can match elements outside of <body>
Capybara can match elements outside body, including head nodes and hidden links, which helps test metadata and feed autodiscovery.
Cucumber steps to test input fields for equality (with wildcard support)
Exact form-field matching in Cucumber prevents false positives from partial values, while wildcards allow flexible contains-style checks.
Zeus promises to make rails development faster
Rails app boot and test startup become slow as gems grow; Zeus preloads the app so console, server, generate, and specs run in under a second.
How Haml 6 changes attribute rendering, and what to do about it
Haml 6 renders most custom attributes verbatim, so falsy values no longer remove them. Boolean attributes keep special handling, and Haml::BOOLEAN_ATTRIBUTES can extend that list.
Test whether a form field exists with Cucumber and Capybara
Capybara and Cucumber can assert whether a labeled form control is present or absent, with step definitions needing adjustment across older Capybara versions.
Accessing JavaScript objects from Capybara/Selenium
Capybara and Selenium can access only browser globals, so exported JavaScript modules fail in evaluate_script unless the component instance is attached to the element.
Capybara: Test that a string is visible as static text
Capybara text checks can match a <textarea> instead of rendered page text; filtering to visible static content avoids false positives.
Test that a string of text is (not) linked in Webrat or Capybara
Cucumber step definitions for asserting whether visible link text is present or absent in Webrat or Capybara using selector-based matchers.
How to: Solve gem loaded specs mutex
Ruby 1.8.7 test runs can fail with Gem::LOADED_SPECS_MUTEX NameError under older Bundler; Bundler 1.16.1 resolves it.
The Plight of Pinocchio: JavaScript's quest to become a real language - opensoul.org
JavaScript has become essential for production applications, but maintainable code still depends on structured design, object-oriented principles, and test-driven development.
Test the content-type of a response in Cucumber
Check a download or page response by its MIME type in Cucumber, using Webrat or Capybara; the Selenium webdriver does not support this approach.
Check whether a Paperclip attachment exists
Paperclip attachment checks can give false positives because the attribute returns an attachment object. Use exists? to test whether a file is actually attached.
Stubbing terminal user input in RSpec
Console input tests are tricky because stubbing Kernel#gets often has no effect. Targeting the object or class that actually calls gets makes terminal input mocks work.
How to generate and test a htpasswd password hash
Create and verify bcrypt password hashes for Apache authentication, with safer handling than command-line password entry.
Code splitting in esbuild: Caveats and setup
esbuild code splitting can reduce main-bundle size, but multiple entry points, chunk cascades, and import-order changes can break builds or runtime behavior.
Test e-mail dispatch in Cucumber
Spreewald Cucumber steps can verify that e-mails were sent with arbitrary conditions, useful for testing mail dispatch logic.
Versatile Cucumber step regarding hovering above elements
A reusable Cucumber step triggers hover events on matched page elements, useful with Spreewald and BEM selector auto-mapping in feature tests.