By default parallel_tests will spawn as many test processes as you have CPUs. If you have issues with flaky...

...component is using this class to render and modify some html, it may fastly become boilerplate to define every call of the method. Here callFake comes in handy, because it...

...of any dependent on the received arguments without having to know the exact arguments beforehand: spyOn(Random, 'shuffle').and.callFake((array) => array.reverse()) Now you can just assume any result of your...

rspec.info

In modern default RSpec configurations, your tests are usually run in random order. This helps to detect "flickering" tests that...

Array.wrap wraps argument in an array, unless it is array-like already. The behaviour is a bit saner than Array[...]. Array.wrap(nil) # => []

" foo bar \n \t boo".squish # => "foo bar boo" Time.current, Date.current, DateTime.current behaves like .now or .zone.now depending on whether a time zone is set

...in development + test, but keep action_on_unpermitted_parameters = false in production, your application behaves different between these environments. On the other hand it forces to fix these errors in...

...Parameters).to receive(:action_on_unpermitted_parameters).and_return(false) for tests, that should behave exactly like in production...

In development, we store files using ActiveStorage's disk service. This means that stored files are served by your Rails...

Tested on Ubunut 22.04 1. Opener script Create a file ~/.local/bin/coverage_zip_opener with: #!/bin/bash tmp_folder="/tmp/coverage-report-opener" if [ -z "$1" ]

makandra dev

This may be awkward to set up, but will work once you're done. Fun facts:

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

...e.g. wysiwyg text fields Consider to leave the paperclip columns (you can debug issues better) As many parts of file processing are not tested (resolution, fallback images and many more...

...exception notifier all failed jobs will trigger an email. Blocking the server: Mogrify (tool behind minimagic) sometimes freeze (for many thousand of jobs it will fail for sure). You need...

Authentication is a special part of web applications. On the one hand, it usually is a crucial security mechanism restrict...

When your Cucumber feature needs to browse the page HTML, and you are not sure how to express your query...

Same requests are recorded only once in vcr. Replaying a test fails, if you trigger the same request multiple times...

makandra dev

While most Rails Apps are tied to at least one external REST API, machine-to-machine communication via GraphQL is...

...a? Capybara::Driver::Selenium Now the selenium driver is located by Capybara::Driver::Selenium. A better-looking approach would be: Capybara.current_driver == :selenium page.response_headers['Content-Disposition'] should be page.response.headers...

postgresql.org

There is no such thing as a "default order" of rows in database tables. For instance, when you paginate a...

Software engineering principles Read about the following software engineering principles and code smells: Single Responsibility Principle Law of Demeter

makandra dev
interfaces.rauno.me

A list of implementation details that make for a better / expected user experience. Have these in mind when implementing a web design. This document outlines a non-exhaustive list of...

When RubyMine reports Rubocop returning "exit code -1", upgrading Rubocop can be the fix: gem install rubocop "The logs" can...

mtlynch.io

...boring style violations. When you demonstrate an appreciation for constructive criticism, your reviewer provides better feedback . Make others better: Your code review techniques set an example for your colleagues. Effective...

To avoid sending e-mails containing sensitive data unencrypted I strongly suggest you enable a confirmation dialog. Enigmail can show...

Web technology is a broad field and you cannot be an expert in all aspects. However, it is useful to...

...GA configurable without changing anything in the application's code base (and much more beyond, see below). Only prefer GTM if the customer requests it, or if he is updating...

...his tracking requirements frequently. The idea behind GTM The "tag" in "Google Tag Manager" has nothing to do with HTML tags, nor with word tags or tag clouds. In the...

...update cucumber Make sure you have a recent version of geordi (it doesn't belong in your Gemfile!): gem install geordi Check if you're using Transforms Transform is no...