Debug flaky tests with an Unpoly observeDelay

Posted Over 1 year ago by Niklas Hasselmeyer.

Unpoly's [up-observe], [up-autosubmit] and [up-validate] as well as their programmatic variants up.observe() and up.autosubmit...

Git commands to discard local changes

Posted Over 1 year ago by Felix Eschey.

You have uncommited changes (you can always check by using git status), which you want to discard.

SEO: The subtle differences of robots.txt disallow vs meta robots no-index

Posted Over 1 year ago by Dominik Schöler.
workingdraft.de

The robots.txt file and HTML tag can be used to control the behavior of search engine crawlers. Both have different...

Rails: Custom validator for "only one of these" (XOR) presence validation

Posted Over 1 year ago by Arne Hartherz.

For Rails models where only one of multiple attributes may be filled out at the same time, there is no...

Rails: Fixing the memory leak / performance issues in prepend_view_path

Posted Over 1 year ago by Dominik Schöler.

Recently we detected a memory leak in one of our applications. Hunting it down, we found that the memory leak...

A short overview of common design patterns implemented within Rails

Posted Over 1 year ago by Emanuel.
paweldabrowski.com

The linked content includes a few design patterns implemented with Ruby on Rails. What is the card indented to achieve...

JavaScript: Testing whether the browser is online or offline

Posted Almost 2 years ago by Henning Koch.

You can use the code below to check whether the browser can make connections to the current site: await isOnline...

Josh McArthur: Fancy Postgres indexes with ActiveRecord

Posted Almost 2 years ago by Florian Leinsinger.
joshmcarthur.com

I recently wanted to add a model for address information but also wanted to add a unique index to those...

Debug file system access in a Rails application

Posted Almost 2 years ago by Tobias Kraze.

It might sometimes be useful to check whether your Rails application accesses the file system unnecessarily, for example if your...

Capybara: Most okayest helper to download and inspect files

Posted Almost 2 years ago by Henning Koch.

Testing file download links in an end-to-end test can be painful, especially with Selenium. The attached download_helpers.rb provides...

RSpec: How to turn off partial double verification temporarily

Posted About 2 years ago by Emanuel.

While verifying doubles in RSpec is a good default, it is limited in the amount of methods it actually is...

ActiveRecord: Query Attributes

Posted About 2 years ago by Julian.

tl;dr You can use attribute? as shorthanded version of attribute.present?, except for numeric attributes and associations. Technical Details

Version 5 of the Ruby Redis gem removes Redis.current

Posted About 2 years ago by Arne Hartherz.

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...

Terminator setup for Procfile-based applications for more comfortable debugging

Posted Over 2 years ago by Klaus Weidinger.

We use foreman to start all necessary processes for an application, which are declared in a Procfile. This is very...

esbuild: Make your Rails application show build errors

Posted Over 2 years ago by Arne Hartherz.

Building application assets with esbuild is the new way to do it, and it's great, especially in combination with...

Carrierwave: How to attach files in tests

Posted Over 2 years ago by Emanuel.

Attaching files to a field that is handled by Carrierwave uploaders (or maybe any other attachment solution for Rails) in...

Capybara: Finding invisible elements and how to test that an element is not visible

Posted Over 2 years ago by Arne Hartherz.
github.com

When Capybara locates elements in the DOM, by default it allows only accessing visible elements -- when you are using a...

Caching in Rails < 6.1 may down parts of your application when using public cache control

Posted Over 2 years ago by Dominic Beger.

Proxy caching is a good feature to serve your publicly visible application content faster and reduce load on your servers...

New gem: Rack::SteadyETag

Posted Over 2 years ago by Henning Koch.
github.com

Rack::SteadyETag is a Rack middleware that generates the same default ETag for responses that only differ in CSRF tokens...

The TCF 2.0 (Tranparency and Consent Framework) standard, and what you should know about it

Posted Over 2 years ago by Tobias Kraze.

The Interactive Advertising Bureau (IAB) is a European marketing association which has introduced a standard how advertising can be served...

Finding ancestors with Capybara

Posted Over 2 years ago by Michael Leimstädtner.
stackoverflow.com

Modern versions of Capybara include a finder method #ancestor which allows you to find a parental element using CSS or...

Using feature flags to stabilize flaky E2E tests

Posted Over 2 years ago by Henning Koch.

A flaky test is a test that is often green, but sometimes red. It may only fail on some PCs...

Semantic HTML

Posted Over 2 years ago by Dominik Schöler.

Besides their default styling properties, HTML elements have a semantic meaning. For example, an h1 tag is usually styled with...

RSpec matcher to compare two HTML fragments

Posted Over 2 years ago by Henning Koch.

The RSpec matcher tests if two HTML fragments are equivalent. Equivalency means: Whitespace is ignored Types of attribute quotes are...