News
When I use controller/request specs and when I don't
Every so often I come across a question of controller or request specs and when to use them.Before I can address this I need to get some terminology out of the way. In RSpec there are controller tests and request specs which are similar but subtly...
Code smell: long, procedural background jobs (and how to fix it)
I’ve worked on a handful of Rails applications that have pretty decent test coverage in terms of model specs and feature specs but are lacking in tests for background jobs. It seems that developers often find background jobs more difficult to test...
How to Migrate Your JavaScript From Sprockets to Webpacker
Back in 2011, Rails 3.1 introduced The Assets Pipeline feature using the Sprockets gem. This made it really easy to handle assets (images, fonts, JavaScript, CSS and more), solving many of the issues that developers had to face everyday.In 2012, W...
Build your own RSpec free Book by Paweł Dąbrowski
I have good news for you!I decided to launch a blog dedicated only to Ruby, so readers are sure they won't read anything that won't be interesting for them. And here it is Long Live Ruby!To say thank you for your patience and trust, I prepared an ...
What's the Best EC2 Instance Type for Rails Apps?
Do you ever look at the list of Amazon EC2 instance types?. Those are sizes of virtual machine you can rent to run your code on. Well, okay, they're groups of sizes, since each one of those headings has a bunch of different sizes of VM...So what t...
Ruby 3.0 Interpolated Strings Are No Longer Frozen
In Ruby, frozen_string_literal: truemakes all string literals frozen by default and it helps in reducing needless memory allocations by not creating a new allocation each time a string is redefined.In Ruby 2.7.1 and earlier versions, interpolated ...