I recently enjoyed debugging a Cucumber step that tried to be retryable using a patiently block: Then /^"([^"]*)" should( not)? be...
Timecop is a great gem to set the current time in tests. However, it is easy to introduce flakyness to...
In a Jasmine spec you want to spy on a function that is imported by the code under test. This...
We usually rely on VCR and WebMock to prevent any real network connection when running our unit tests.
Jasmine specs for the frontend often need some DOM elements to work with. Because creating them is such a common...
Jasmine specs that work with DOM elements often leave elements in the DOM after they're done. This will leak...
While in CSS zero is usually referenced without specifying a unit (e.g. padding: 0), you must not use a unitless...
sass >= 1.35.0 has the option quietDeps and silenceDeprecations to silence deprecation warnings from dependencies. quietDeps: No deprecation warnings for dependencies...
ActiveType::Object inherits from ActiveRecod::Base and is designed to behave like an ActiveRecord Object, just without the database...
Unpoly's [up-observe], [up-autosubmit] and [up-validate] as well as their programmatic variants up.observe() and up.autosubmit...
You can use ETags to allow clients to use cached responses, if your application would send the same contents as...
One rule of thumb I try to follow in capybara tests is using capybara matchers and not plain rspec matchers...
tl;dr In RubyMine you can use find and replace with capture groups (.*?) and backreferences $1 (if you have several...
Ruby's standard library includes a class for creating temporary directories. Similar to Tempfile it creates a unique directory name...
To allow HTTP 304 responses, Rails offers the fresh_when method for controllers. The most common way is to pass...
Greg Molnar has written a neat article about creating a single-file Rails app. This is not meant for production...
You can use the code below to check whether the browser can make connections to the current site: await isOnline...
When changing code in mailers, updating the corresponding mailer preview can be forgotten very easily. Mailer previews can be tested...
Testing file download links in an end-to-end test can be painful, especially with Selenium. The attached download_helpers.rb provides...
While verifying doubles in RSpec is a good default, it is limited in the amount of methods it actually is...
There is a way to use multiple databases in Rails. You may have asked yourself how you're able to...
You can use Unpoly's up.on with a named listener function and immediately unbind this event listener with { once: true...
Due to the way we setup Jasmine tests in our projects, you may run into various errors when Jasmine boots...
When the order matters: expect(array1).toEqual(array2) Regardless of order: expect(array1).toEqual(jasmine.arrayWithExactContents(array2)) Ignoring extra elements: