To reverse lookup a fixture by its table name and id, use the following approach on ActiveRecord::FixtureSet: table = 'users...

Warning safe_constantize is not safe for unfiltered user input In Rails, the safe_constantize method is a powerful tool...

tl;dr When a cookie includes an Expires attribute or an HTTP response includes caching headers like Expires or Cache...

evilmartians.com

Some key highlights and points from the linked article TestProf II: Factory therapy for your Ruby tests. The Problem with...

masilotti.com

Slow test suites are a major pain point in projects, often due to RSpec and FactoryBot. Although minitest and fixtures...

While the main goal always is to prevent long-running queries in the first place, automatic timeouts can serve as...

The ActiveSupport::BroadcastLogger allows you to log to multiple sinks. You know this behavior from from the rails server command...

Starting with ChromeDriver 127, if your application displays a beforeunload confirmation dialog, ChromeDriver will immediately close it. In consequence, any...

Recently I needed to benchmark an Active Record query for performance measurements. I wrote a small script that runs each...

testing-library are widely used testing utilities libraries for javascript dependent frontend testing. The main utilities provided are query methods...

Whenever you have to deal with randomness in a jasmine test there are some spy strategies to help you out...

sudo gitlab-rails console Note This takes some minutes to start Send a mail Use the following...

stevenhicks.me

Sometimes you want to write a test for a business rule that's based on multiple variables. In your goal...

tl;dr To adjust code templates in RubyMine, navigate to Settings -> Editor -> File and Code Templates. Example You can navigate...

If you want someone to be able to access your rails console, but don't want them to be able...

You might know a few examples, where you configure some library via a block. One example is the Rails configuration...

When you mocked method calls in RSpec, they are mocked until the end of a spec, or until you explicitly...

As we're switching from PT to Linear, I've updated the existing bash script to work for commits that...

open-ui.org

tl;dr When browsers start to adapt proposals from Open UI, it might not be necessary to use any 3rd...

Debugging performance issues in your Rails app can be a tough challenge. To get more detailed insights consider using the...

makandra dev

There are two ways a logout in SAML can happen: Service Provider (SP) initiated and Identity Provider (IDP) initiated logout...

tl;dr Prefer request specs over end-to-end tests (Capybara) to joyfully test file downloads! Why? Testing file downloads

I recently noticed a new kind of flaky tests on the slow free tier GitHub Action runners: Integration tests were...

makandra dev
whattrainisitnow.com

The linked table shows the support lifecycle for Firefox Extended Support Releases (ESR) which we sometimes need to support for...