Tutorials
Sharing common code between Rails controllers with Scoped pattern
This particular pattern comes from DHH and Basecamp – a codebase that prides itself of using lots of tiny concerns to share bits of behavior.While the savings of repeating the same before_actions to look up a Channel would be a fine benefit on it’...
Recording real requests with WebMock | Arkency Blog
Caveat: it’s global, i.e. it’ll apply to all the test cases you’ll run. If you want it for just one test case, run just a single one.(As far as I tried, there’s no easy way to cleanly make it per-example with an around hook, because that would mea...
Build a Ruby App with CockroachDB and ActiveRecord | CockroachDB Docs
Learn how to use CockroachDB from a simple Ruby script with the ActiveRecord gem.This tutorial shows you how build a simple Ruby application with CockroachDB and ActiveRecord. CockroachDB provides an ActiveRecord adapter for CockroachDB as a RubyGem.
Testing multiple sessions in the same test with Capybara
Sometimes a feature in your application will involve a back-and-forth between multiple users. When it comes time to write an automated system test, you can easily simulate switching between users using Capybara’s using_session helper.Instead of lo...