Taking advantage of RSpec's "let" in before blocks

before :each blocks can use let values declared later, enabling per-context setup without predeclaring variables; local variables inside it blocks do not work.

RSpec: Change the type of a spec regardless of the folder it lives in

Rails specs can get controller, model, or request helpers from directory-based inference; :type forces the desired context even when a file lives elsewhere.

Using the full power of have_css

Capybara has_css? can assert selector counts and text content, including substring matches; exact text requires finding the element and comparing it directly.

JavaScript: How to check if an object is NaN

NaN is difficult to compare in JavaScript because it never equals itself. Object.is() works in ES6; ES5 needs a number type check plus isNaN().

shoulda-matcher methods not found in Rails 4.1

allow_value and other shoulda-matchers methods can disappear under Rails 4.1 with Spring, causing NoMethodError despite the gem being listed.

Colorful output for several linux command line tools: grc

Adds colorized terminal output to common Linux commands, making logs and status output easier to scan in the shell.

Jasmine: Expecting objects as method invocation arguments

Jasmine spy assertions can match invocation arguments by type, partial object shape, or any value using jasmine.any(), jasmine.objectContaining(), and jasmine.anything().

Machinist's #make breaks on has_many associations when defining method `empty?`

Custom empty? on a has_many model can break Machinist collection building, creating records with the wrong foreign key. Use explicit association assignment instead.

Fix: Cucumber won't start though cucumber.yml is correct

cucumber.yml may be valid while rerun.txt is corrupted by parallel Cucumber workers writing at the same time, preventing Cucumber from starting.

Stubbed class methods in RSpec 1 remain stubbed in other examples

RSpec 1.x can leave stubbed class methods in place between examples, causing order-dependent failures when spec file evaluation changes.

Run a single Cucumber feature

Run one Cucumber feature file directly with script/cucumber, or invoke it through rake when speed is less important.

How to enable Rails' file_fixture helper in FactoryBot

FactoryBot factories do not get Rails' file_fixture helper by default; including RSpec Rails file fixture support makes file_fixture available and sets the fixture path.

Fixing AfterAll TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'

Jasmine describe() throws AfterAll TypeError: Failed to execute 'appendChild' on 'Node' when an object is passed instead of a string.

Cucumber fails without giving error message

Cucumber can fail with little or no visible error output; a backtrace, verbose formatter, or debug mode can expose the underlying cause.

Monitoring a network connection from a remote host

Network failures between a host and a single target can be isolated with ping checks and an automatic mtr report by email.

Always show the page if there is an error in Cucumber

Cucumber failures can open the current page in a browser automatically, avoiding repeated "Then show me the page" reruns and speeding up debugging.

RSpec 2.6 supports "any_instance" now

any_instance stubbing and expectations now work in RSpec 2.6, enabling should_receive and stub on instances created inside code.

Nested Spreewald patiently blocks are now patient

Nested patiently blocks now wait independently in Spreewald, preventing detached DOM failures when with_scope reuses cached elements.

Find an ActiveRecord by any column (useful for Cucumber steps)

Finds a record by any string or number across columns, making Cucumber step definitions more flexible. The bang variant raises ActiveRecord::NotFound when nothing matches.

Cucumber step to manually trigger javascript events in Selenium scenarios (using jQuery)

Selenium can miss browser events such as change during form input; a Cucumber step can fire jQuery-registered events manually with execute_script.

Machinist blueprints: Do not set associations without blocks

Association values in Machinist blueprints need blocks so Project.make runs per blueprint instance, not once at parse time when RSpec loads.

Using RSpec's late resolving of "let" variables for cleaner specs

Lazy let evaluation keeps RSpec examples shorter when a setup call has many required arguments, and lets stubs change the result before the value is used.

Cucumber 4 and VCR integration

VCR integration with Cucumber 4 breaks when use_scenario_name: true is enabled, causing an undefined feature method error in Cucumber::RunningTestCase::TestCase.

Do not use "find" on Capybara nodes from an array

Capybara find can return incorrect matches when called on nodes from all, especially with text filters. Use a full selector on the page to scope the search reliably.