Stop writing "require 'spec_helper'" in every spec
Configure .rspec to load spec_helper or rails_helper automatically, avoiding repeated require lines in every spec and making parallel test setups work with .rspec_parallel.
Cucumber: Test that an element is not overshadowed by another element
Detects whether a visible page element is covered by another layer, such as a modal overlay or higher z-index element, using a browser hit test.
Testing drag&drop with Selenium
Selenium webdriver cannot trigger native drag events, making drag-and-drop interfaces hard to test. jQuery-based simulation libraries can emulate sortable interactions in test code.
RSpec: How to test the content of a flash message in a request spec
Rails request specs can verify flash messages in the response, letting controller updates surface user feedback such as success or alert notices.
Shoulda Matchers: how to test conditional validations
Conditional Rails validations with if: are not covered by Shoulda Matchers; test the model’s behavior by stubbing the predicate and checking presence only when it applies.
Test a gem in multiple versions of Rails
Rails gems that must support several framework releases need separate test apps per version. Shared code and specs reduce duplication while keeping version-specific coverage.
Check that an element is hidden via CSS with Spreewald
CSS-hidden text can pass Rack::Test because it inspects only the DOM, while Selenium checks actual visibility for user-facing content.
How to test print stylesheets with Cucumber and Capybara
Print stylesheets often regress as apps evolve, leaving paper output cluttered or unreadable. Cucumber and Capybara can verify visible content, white backgrounds, and hidden controls.
Namespacing: why `uninitialized constant` error may occour in `development` but not in `test` environment
Namespaced Ruby classes can raise uninitialized constant in development when autoloading misses a nested class, while test may pass because everything is already loaded.
Jasmine: Reset the location when testing code that uses pushState / replaceState
Browser navigation during pushState or replaceState tests can leave Jasmine on the wrong URL and break test reruns. Saving and restoring the location keeps the suite on the spec page.
Firefox: Focus-sensitive Selenium tests do not work reliably in parallel test execution
Firefox suppresses focus and blur events when its window is unfocused, making Selenium tests flaky in parallel execution. ChromeDriver is the recommended workaround.
Fix warning: Cucumber-rails required outside of env.rb
Bundler 1.1 can trigger a misleading Cucumber warning during test runs; disabling automatic loading for cucumber-rails removes it without moving the gem into a test group.
Ruby: A small summary of what return, break and next means for blocks
return, break, and next behave differently in Ruby blocks: one exits the method, one exits the yielding method, and one skips only the current iteration.
Why you see a GET "/__identify__" request in Capybara tests
Unexpected GET /__identify__ requests in Capybara test logs come from server readiness checks for Selenium-style drivers; Capybara answers them with middleware when no route exists.
RSpec Argument Matchers: Expecting non-primitive objects as method invocation arguments
RSpec can verify method arguments that are objects by class, interface, attributes, equality, or custom block checks instead of simple primitive values.
How to circumvent Firefox's "Document expired" page in Selenium tests
Firefox blocks back navigation to POST results with a “Document expired” page, which can disrupt Selenium tests that need to verify recovery from this browser protection.
howto fix spreewald issue „database configuration does not specify adapter (ActiveRecord::AdapterNotSpecified)“
Spreewald fails with ActiveRecord::AdapterNotSpecified when database.yml defines Cucumber settings instead of test settings. Renaming the environment entry to test resolves the adapter error.
Capybara: Disable sound during Selenium tests
Integration tests can trigger browser audio; passing --mute-audio to Chrome through Capybara’s Selenium driver disables sound. No equivalent Firefox command-line option is noted.
Rails: Parsing a time in a desired timezone
Create a Time in a fixed timezone regardless of Rails or system settings; useful for tests and API date comparisons when parsing otherwise shifts by environment.
How to communicate between processes in Ruby with sockets
Interprocess communication in Ruby can use UNIX sockets for parent-child coordination, parallel test synchronization, and waiting for child cleanup after fork.
Selenium: Network throttling via Chromedriver
Throttle headless Chrome network conditions in Selenium to debug flaky integration tests and simulate slow page loads.
Fix randomly failing PDF cucumber tests
PDF Cucumber tests can fail intermittently on the first run when generation is not ready. A readiness step waits for PDF output before checking contents.
Jasmine: Testing AJAX calls that manipulate the DOM
AJAX DOM updates are hard to test when requests are asynchronous and the target element is missing. jasmine-ajax, jasmine-fixture, and done make network mocking and DOM setup possible.
Consul: Querying a power that might be nil
Authorization checks stay safe when Power.current is missing, so models can run in consoles, tests, and batch jobs without crashing.