Simplecov is a code coverage tool. This helps you to find out which parts of your application are not tested...
...cat tmp/parallel_cucumber_failures.log | xargs geordi cucumber # Running features > Only: features/authentication.feature:33 features/backend/pages.feature:5 features/backend/pages.feature:60 ... Beside the linked article you might also be interested in reading An Opinionated Guide to xargs...
By default parallel_tests will spawn as many test processes as you have CPUs. If you have issues with flaky...
...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...
The File System Access API is a new capability of modern browsers that allows us to iterate over selected folders...
We use Sentry to be informed about different kinds of issues. One of the key features is that you are...
There's a method Integer() defined on Kernel, that typecasts everything into an Integer. Integer("2") # 2 Integer("foo") # Invalid...
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...
Rails offers the fresh_when method to automatically compute an ETag from the given record, array of records or scope...
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" ]
All Rubyists should be familiar with the common definitions for include and extend. You include a module to add instance...
Let the following setup: # my_model_spec.rb describe MyModel do it 'perfoms a test' it_behaves_like 'something shared' end # something_shared.rb shared_examples_for 'something shared' do it 'does something'
...a test' is spec/models/my_model_spec.rb[1:1]. The ID of the ExampleGroup created by it_behaves_like 'something shared' is spec/models/my_model_spec.rb[1:2] as it is the second ExampleGroup in the...
...the resulting record will not have the attributes that defined that scope, and this behavior can be quite useful. Because you cannot have the best from both worlds you should...
...article and make informed choices about how to define your conditions. Also see the Best Practice section below. The problem in detail Consider this Rails class and the following articles...
=> #<Capybara::Node::Element tag="div" path=... If you rely on this behavior in Capybara 3, affected features will fail. The gem no longer normalizes whitespace when finding...
...visible css ".haystack" with text "Hi! Try to match me." Re-enabling Cabyara 2 behavior in Capybara 3 After digging in the documentation, you might figure out that you can...
I had to modify the time for an application that I launch through Docker. Here is an approach that worked...
There is no such thing as a "default order" of rows in database tables. For instance, when you paginate a...
While most Rails Apps are tied to at least one external REST API, machine-to-machine communication via GraphQL is...
When RubyMine reports Rubocop returning "exit code -1", upgrading Rubocop can be the fix: gem install rubocop "The logs" can...
Same requests are recorded only once in vcr. Replaying a test fails, if you trigger the same request multiple times...
Some browsers render PNG images with color profiles and other shenanigans, some do not. The cleanest way to have consistent...
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...
...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...