In a Jasmine spec you want to spy on a function that is imported by the code under test. This...
In esbuild, you usually import other files using relative paths: import './some-related-module' import `../../utils/some-utility-module` import `../../../css/some-css.sass` This is totally fine...
ActiveType::Object inherits from ActiveRecod::Base and is designed to behave like an ActiveRecord Object, just without the database...
Here are a few common patterns that will probably lead to flaky specs. If you notice them in your specs...
When you build a JSON API you need to come up with a style to represent attributes, pagination, errors or...
Beim schreiben von Scripts ist es nützlich Tests zu schreiben um bei Änderungen nicht alles nochmals manuell testen zu müssen...
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...
Redis.current will be removed without replacement in redis-rb 5.0. Version 4.6.0 adds deprecation warnings for Redis.current and Redis.current=: `Redis.current...
RSpec's let allows you to super into "outside" definitions, in parent contexts. Example: describe '#save' do subject { described_class.new(attributes...
To ensure a consistent code style for JavaScript code, we use ESLint. The workflow is similar to integrating rubocop...
Attaching files to a field that is handled by Carrierwave uploaders (or maybe any other attachment solution for Rails) in...
When Capybara locates elements in the DOM, by default it allows only accessing visible elements -- when you are using a...
Jasmine is a great tool to unit test your JavaScript components without writing an expensive end-to-end test for...
Learn to create test data effectively using factories. Decouple tests by having each test start with an empty database...
RSpec Rails can automatically mix in different behaviors to your tests based on their type tag, for example enabling you...
You can use RSpec::Matchers.define_negated_matcher to define a negated version of an existing matcher. This is particularly useful...
Jasmine is a great way to unit test your JavaScript components without writing an expensive end-to-end test for...
A flaky test is a test that is often green, but sometimes red. It may only fail on some PCs...
Basic validations Read the Rails Guide on ActiveRecord Validations. You should have an overview which kinds of validations are built...
Within development and test environments, Rails is usually configured to show a detailed debug page instead of 404s. However, there...
This RailsCast demonstrated a very convenient method to activate VCR for a spec by simply tagging it with :vcr.