Tutorials
URI.escape is obsolete. Percent-encoding your query string
Ruby 2.7.0 shows a warning when invoking URI.escape or its alias, URI.encode. It might look like a fresh deprecation, but the fact is, these methods have been marked as obsolete for… over 10 years now! If you’re wondering how come you’ve never enc...
RSpec/Capybara integration tests: the ultimate guide
When I started learning about Rails testing and RSpec I discovered that there are many different kinds of tests. I encountered terms like “model spec”, “controller spec”, “view spec”, “request spec”, “route spec”, “feature spec”, and more. I asked...
Where to start with introducing TDD to a new Rails app
A Code With Jason reader recently wrote me with the following question:How do I introduce TDD into a new Rails app? Where do I start? I am deeply knowledgable on RSpec and use it a lot. I am not sure how to get started with testing in Rails. When ...
Effectively Using Materialized Views in Ruby on Rails
It's every developer's nightmare: SQL queries that get large and unwieldy. This can happen fairly quickly with the addition of multiple joins, a subquery and some complicated filtering logic. I have personally seen queries grow to nearly one hundr...