Tutorials


Avoiding Network Calls In Rails Tests Without Using Mocks, Stubs or VCR - Code with Jason
An important principle of testing is that tests should be deterministic. The passing or failing of a test shouldn’t depend on the date it was run, whether any certain other tests ran before it, or whether some condition outside the application cha...






How to test Ruby output and logs using RSpec with StringIO
Testing what is logged when you application is run can be done with testing method calls to your logger. However, using StringIO to capture and examine its output can provide several advantages, such as being able to record output and perform test...

Ruby on Rails Callbacks - DRY out your models using Concerns
When writing an extension for a Ruby on Rails model, an ActiveSupport Concern could be a good choice. They work like mixin modules that can be included in a class, but have some extra benefits for Rails models, such as the ability to add Callbacks...

Uploading images from Rails to DigitalOcean Spaces, with previewing
So I wanted to make my site a little bit more friendly looking, and using profile pictures seemed like a good idea. In my case, users can upload projects, which other people can join. There are no user accounts, every user is visiting as a guest, ...