Everyday Rails

Archives

Testing with RSpec book updates for October 2024

Brand new chapter on testing controllers via request specs, and more! (October 10, 2024)

Testing with RSpec book updates for September 2024

Now with an updated take on DRY tests and creating test data with factory_bot! (September 04, 2024)

Testing with RSpec book updates for July 2024

Finally, here's the first release of my RSpec testing book, updated for the latest Rails stack! (July 21, 2024)

Replacing system tests with unit tests

Is your testing strategy too top-heavy? Here are some techniques to spread coverage down the testing pyramid. (June 01, 2024)

Calling all cooks: Share a recipe, get a free book!

Want a great deal on my RSpec book, or a free copy of my next project? (May 20, 2024)

Testing with RSpec book May 2024 status report

How it started, how it's going, what I've learned, and a revised delivery timeline for book updates. (May 04, 2024)

Notes from migrating from Minitest to RSpec, with help from GitHub Copilot

Artificial intelligence hasn't replaced us yet, but how does it handle the boring parts of our jobs? (March 13, 2024)

Why I’ve started using justfiles in my Rails apps

Boost your developer experience with consistent command line interfaces. Here's how. (February 24, 2024)

New version of Testing with RSpec book for 2024!

A new edition is in the works, with coverage on the latest versions of Rails, Ruby, and RSpec, and more. (February 06, 2024)

Using devcontainers in GitHub Actions CI workflows

It's simpler than ever to wire CI pipelines, thanks to devcontainers. Here's how I run Rails test suites these days in GitHub workflows. (January 14, 2024)

Write resilient tests with matchers that take other matchers

Here's a short, neat trick to help save time when updating RSpec specs to reflect new test data. (December 07, 2023)

A few things I've learned to simplify working in dev containers

I'm still learning as I go, but here are some tidbits I've learned so far about using dev containers for most of my software projects these days. (September 05, 2023)

Test-driven development in the age of artificial intelligence

How ChatGPT, GitHub Copilot, and TDD made me a professional Go programmer in less than an hour. Kind of. (June 26, 2023)

Deprecating code in a Rails application

Here's how to add good deprecation warnings to your Rails applications, and why it might be a good idea. (July 31, 2021)

Automatic code review with Pronto and GitHub Actions

Nobody likes to be the one to pick through your pull request for style guide and security violations. Here's how to ask robots to do the work for you, automatically! (May 29, 2021)

Working around the mimemagic issue in my RSpec testing book

The book's sample source no longer installs due to a dependency change. Here's how to fix it. (April 05, 2021)

Using containers as a Rails development environment, part 4: Composing services

Before integrating additional services into a container-based development environment, we need to start thinking about the app as a collection of services. Here's how to begin that process. (March 14, 2021)

Using containers as a Rails development environment, part 3: SQLite databases

You can't get very far with a Rails application without a database. Let's explore our options for adding one in a container. (March 07, 2021)

Persist existing data when setting up a Rails development environment

Rails support for automating development environment setup includes a behavior that may surprise you! Here's how I addressed it in my applications. (February 28, 2021)

Docker containers for Rails development environments, part 2: Setup

In our first experiment, let's see what it takes to get a Rails app to boot in a Visual Studio Code devcontainer. (February 21, 2021)

Docker containers for Rails development environments, part 1: Introduction

Let's experiment with building sensible devcontainers for Rails. Here's the plan. (February 14, 2021)

Everyday Rails now uses Plausible for analytics

Why I've moved to the simple, privacy-focused Plausible for my visitor analytics needs. (December 03, 2020)

Modern command line alternatives

As Ruby developers, we spend much of our programming time in terminal emulators, at a command line. Here are some of my favorite alternatives to traditional command line tools, and how I've got them configured to my personal taste. (September 20, 2020)

Thoughts on Everyday Rails 2020 redesign

Everyday Rails gets a fresh coat of paint after five years. Here's what went into the new look. (September 17, 2020)

Start with what you know

Learning something brand new? Think again, it's probably got some overlap to skills you already have. Here's one way I approach learning to make it a more effective, intentional process. (August 24, 2020)

2 ways to test Rails log messages with RSpec

If you're like me and don't need to test log output on a regular basis, you may not find the solutions to be immediately obvious. Here are two ways (that I know of) to approach the problem. (August 10, 2020)

Rails application templates made even easier with Rails Bytes

Application templates aren't just for new Rails apps! Stop copy-pasting configurations and get back to productivity with modular templates from this promising new service. (July 06, 2020)

Rails architecture tips from route helpers

A subtle feature of Rails routing gave me a new appreciation for the attention to detail that the authors of the Rails framework put into making it a pleasant development experience. (June 22, 2020)

Work around flaky test failures in Rails with rspec-retry

Nobody likes an intermittently failing test. Here's one way to keep your test suite running green, even when a test sometimes fails. (June 08, 2020)

5 great newsletters for the productive Rails developer

Here are my favorite subscriptions for keeping up with Rails, Ruby, and my world of software development. (May 25, 2020)

Happy 10th birthday to Everyday Rails!

Looking back on a decade of writing about Ruby on Rails. (May 18, 2020)

Getting started with a legacy Rails application

There's a good chance that your next Rails job will involve working with an existing application. Here's how I've recently gone about learning several new-to-me codebases. (May 11, 2020)

Everyday Rails Testing with RSpec book price changes

Want a legit copy of my Rails testing book for free, or heavily discounted? (April 15, 2020)

How to TDD when TDD is hard

Sometimes, TDD gets in the way, does more to confuse than guide, or generally just slows development to a monotonous crawl. Here's a set of five go-to strategies I use to get out of test-fueled frustration, and back to productivity. (July 09, 2019)

Replace chromedriver-helper with webdrivers (a public service announcement)

My recommended setup for testing JavaScript in Rails has changed. Read on to learn about the switch to webdrivers. (April 09, 2019)

7 reasons why learning SQL is still important for Rails developers

Active Record abstracts away much of the need to use SQL on a daily basis. But understanding what's going on behind the scenes is still important. Here's how understanding SQL can make you a better Rails developer. (February 18, 2019)

Everyday Rails Testing with RSpec book updates for August 2018

A new version of my book, featuring a migration to system specs and a couple of major errata fixes, is ready for download from Leanpub! (August 22, 2018)

My recent appearances on Ruby podcasts

In case you missed it, I've guested on a couple of podcasts in 2018. (July 18, 2018)

Simple shortcuts to get more out of Bundler

Ruby's dependency manager, Bundler, includes lots of features to help make life as a developer a little easier. Here are a few of my favorites, and the shortcuts I've written to make them even simpler to use. (June 11, 2018)

Status report: Everyday Rails Testing with RSpec updates for spring 2018

A progress report on the latest round of updates to my Rails testing book. (April 21, 2018)

Rails test coverage: Measuring what matters with SimpleCov

Many developers strive for 100% test coverage in their Rails applications, but what does that mean? And does it matter? Here's how I use the wonderful SimpleCov to help guide my testing. (March 23, 2018)

Upgrading to RSpec 3.7.2 and system specs

Support for Rails 5.1 system testing is now available to RSpec fans like you and me. Here's how I moved my book's feature specs to system specs. (January 08, 2018)

A general guide to upgrading Ruby in your Rails applications

It's the middle of December, which means a new version of Ruby will be released in just a few days. Even if you don't plan on upgrading your Rails applications to the latest version on day one, it's never a bad time to begin planning your next upgrade. (December 18, 2017)

Replacing RSpec controller tests, part 3: Removing business logic from controllers

Do you need yet another reason to move code out of controllers and into service (or whatever you want to call them) objects? How about better, forward-thinking testability? (November 20, 2017)

2017 edition of Everyday Rails Testing with RSpec is content-complete!

The final chapter of my Rails testing book is now available for download. Here's what's new, and what's coming next. (October 19, 2017)

Testing with RSpec book updated for 2017

I've released the first seven chapters (plus one) of an all new edition of my popular introduction to RSpec for Rails. Here's what's new, and what to expect next. (June 20, 2017)

Generating application documentation in Rails 5

Support for generating an HTML version of application documentation in Rails 5 was removed. Here's how to add it back. (March 01, 2017)

Status report: Everyday Rails Testing with RSpec for RSpec 3.5 and Rails 5

A progress report on the latest version of my Rails testing book. (February 20, 2017)

Ask the reader: What versions of Rails do your apps currently use?

An experiment! This week, let's have an open floor discussion about Rails versions in production, and what keeps us from upgrading sooner. (January 23, 2017)

Code reviewing as a mindset

Code reviews are more than proper indentation and method length. They're about understanding your software, and developing a better team of developers. Here's my approach to the code review practice. (January 16, 2017)

Going HTTPS-only in Rails with Let's Encrypt

Serving your Rails application over HTTP? Starting this month, your users may start receiving security warnings when visiting your site. Protect their safety and privacy quickly and easily with Let's Encrypt. (January 09, 2017)

Everyday Git: Search the git log from the command line

Your project's git log can tell you stories, but you have to know how to look for them. Here's how I explore a code base's history, using built-in command line tools. (January 02, 2017)

Rails security essentials

Rails provides excellent support for software security, but you need to know how and when to apply those supports for them to work. Here's an overview of tools you can use to keep your applications safe. (December 12, 2016)

Updates to Everyday Rails Testing with RSpec for Rails 5 and RSpec 3.5

A big update to my testing book is coming in 2017. Here's a list of things to expect in the new edition. (December 05, 2016)

Replacing RSpec controller specs, part 2: Feature specs

In part two of a series on ditching controller specs, let's move a complicated controller example into a more reasonable, future-proof feature spec. (September 05, 2016)

Replacing RSpec controller specs, part 1: Request specs

Does your application's test suite rely heavily on controller specs? It's time to consider alternatives, as controller testing has changed in Rails 5. Here's one way to replace a common use of these specs, even if you haven't upgraded to Rails 5 yet. (August 29, 2016)

Improving Rails application documentation

I've been thinking about how to improve the quality of Rails code bases through better documentation practices. Here are some steps I'm taking in my own projects. (April 18, 2016)

Clearance: The other Rails authentication gem

Looking for a well-balanced authentication solution? Check out Clearance as an alternative to Devise and has_secure_password. (January 23, 2016)

Using RSpec in Atom

I love how extensible GitHub's Atom editor is. Here are some useful packages for using it to edit and run RSpec tests. (August 27, 2015)

Everyday Rails redesign for 2015: Initial notes and reflections

A behind-the-scenes look at the tools and decisions that led to the first major redesign of Everyday Rails in three years. (August 09, 2015)

Cloning Active Record objects and their associates with Deep Cloneable

Here's how I created sanitized sample data from real-world data, using a few lines of Ruby code and a very useful gem. (July 29, 2015)

How do assigns and reload work in Rails tests?

Rails offers a couple of methods to access persisted test data, but how do they work? Let's get some answers, with the help of Pry. (April 05, 2015)

Automating code review with Pronto (and friends)

Pronto helps streamline the code review process by automating what can be automated, so you can focus on the code's intent and design. Here's one example of how to use it. (February 17, 2015)

Switching from Selenium to Poltergeist in RSpec feature specs

A quick one, for readers of my RSpec book: Moving to a headless driver for faster JavaScript testing with Capybara. (January 27, 2015)

Simple data transfer with YamlDB

Ever need to transfer data from one database to another? Here's a solution that worked for me. (December 23, 2014)

Everyday Rails Testing with RSpec now updated for RSpec 3

RSpec 3.1, Rails 4.1 (and beyond), testing services, and more: Here's what's new. (October 05, 2014)

Everyday Rails Testing with RSpec: Upcoming updates for 2014

It's getting time for the book's annual-ish update. Here's a look at what's planned for the next version. (April 03, 2014)

Everyday Git: Clean up and start over

Git makes it easy to experiment with ideas before committing them for posterity. Here's one way to get rid of those experiments when they go bad. (February 27, 2014)

Japanese translation of Everyday Rails Testing with RSpec

A Japanese version of my testing book is now for sale on Leanpub. (February 08, 2014)

Looking for the Rails 3.2 edition of Everyday Rails Testing with RSpec?

The previous edition of my book is now a free extra with all purchases of the current edition. (January 25, 2014)

A great example of outside-in testing from Ruby Tapas

How do you turn testing knowledge into a testing habit? Learn from an expert. (January 15, 2014)

I wrote a view spec

When is it beneficial to include a view spec in your Rails app's test suite? Here's one example. (November 15, 2013)

Chinese translation of Everyday Rails Testing in RSpec now available

A Chinese version of my testing book is now for sale on Leanpub. (September 09, 2013)

Testing with RSpec for Rails 4 is done

Information on the final release, and a note on what's up next. (August 21, 2013)

Everyday Rails Testing with RSpec: Where are the Rails 4.0 updates?

Updated development schedule for all who've purchased my RSpec book. Short answer: They're coming! (July 16, 2013)

Obfuscating data in Rails applications for screenshots and demonstrations

Faker isn't just for testing; here's how I used it to use real data in demonstrations (without revealing anything sensitive). (May 20, 2013)

Everyday Rails Testing with RSpec: Updates for April, 2013

Wrapping up Rails 3.2 and looking ahead to Rails 4.0. (April 24, 2013)

Diary of a Rails rescue project, part 2: Testing

Notes on using tests to learn about legacy software. (April 16, 2013)

Diary of a Rails rescue project

Notes from the field as bring a long-neglected Rails application up to speed. (March 21, 2013)

Everyday Rails Testing with RSpec, the book now covers Capybara 2.0, RSpec's new syntax, and more

The next round of updates to my introduction to testing in Rails is here! (February 13, 2013)

Everyday Rails Testing with RSpec: News and update plans

Updates to the Rails testing toolkit I use in the book are on the way (or here already). Here's my plan for addressing these changes. (November 14, 2012)

Bundler tip: Always specify gem versions

Don't make future developers (or future you) guess your application's dependencies. Tell Bundler how to load the right gems every time. (September 11, 2012)

Creating a Rails admin panel from scratch, part 3: Other resources

In the final part of this series, we'll create a fresh controller and views to manage an ActiveAdmin resource within our namespaced admin panel. (August 19, 2012)

Creating a Rails admin panel from scratch, part 2: Scaffolded resources

In part two of the series, we'll take a look at moving a scaffold-generated resource into our custom admin panel. (August 07, 2012)

August 2012 updates for Everyday Rails Testing with RSpec

Anyone who's purchased my book should head over to Leanpub to download the latest version. Here's a list of what's new. (August 03, 2012)

Creating a Rails admin panel from scratch, part 1: The dashboard

Add-ons like ActiveAdmin and RailsAdmin are both solid solutions for building feature-rich administration systems for Rails applications, but what if you want a more custom solution? In this series we'll cover the test-driven development of a namespaced admin solution built just for your application. (July 31, 2012)

Everyday Rails Testing with RSpec: The Book is complete

The expanded version of my series on learning to test is ready for non-early adopters. Here's more information on the Rails 3.2 version of the book, and what's to come later. (June 13, 2012)

Update on the RSpec book

I've been busy completing the book and incorporating your feedback. Here's where things stand at the moment, along with answers to some questions I've received. (May 15, 2012)

Everyday Rails Testing with RSpec: Get advance access to my new book now

I'm happy to announce that the extended, DRM-free ebook version of my RSpec series is now available for purchase through Leanpub. Here's a rundown of what's there now and what's to come. (May 07, 2012)

How I learned to test my Rails applications, Part 5: Request specs

Integration testing with RSpec request specs make sure your application's various parts are working in cohesion. Here's a primer on getting started. (April 24, 2012)

How I learned to test my Rails applications, Part 4: Controller specs

Controllers are the glue in a Rails application, and should be tested just like any other code. This primer will guide you to better coverage in your own apps' controllers. (April 07, 2012)

How I learned to test my Rails applications, Part 3: Model specs

How can you make sure your application's core building blocks are doing what you expect them to? Let's start by using RSpec to test model functionality. (March 19, 2012)

How I learned to test my Rails applications, Part 2: Setting up RSpec

Our series on getting comfortable with Rails testing continues as we set up RSpec for an existing application. (March 12, 2012)

How I learned to test my Rails applications, Part 1: Introduction

Are you still wrapping your head around Rails testing techniques? Here are the tools and techniques that helped me go from zero to decent test coverage. (March 12, 2012)

More advice on legacy data migration in Rails

What do you do if your legacy data defies convention or is just generally complex? Here are some notes from my recent experience using rake to accomplish difficult data migrations. (December 11, 2011)

How I've been developing an administrative backend with ActiveAdmin

Rails developers with deadlines will love ActiveAdmin for building high-quality interfaces for managing a site's data. (November 11, 2011)

Authorization advice for Rails 3 and beyond

Here's the general process I follow whenever adding authorization—the logic that says what a user's allowed to do—to my Rails applications. (October 06, 2011)

Rails authentication today: Options for 3.0 and 3.1

There's no shortage of approaches to adding password-based security to your Rails applications. Here's a look at the current lineup. (September 21, 2011)

Migrate data to Rails applications with Trucker

Get legacy data? Trucker makes moving it from old codebases into new Rails apps with relative ease. (September 16, 2011)

MailForm: Easy e-mail contact forms for your Rails apps

Get e-mail feedback from your site's visitors though this simple-to-implement web form. (September 07, 2011)

Simple, user-friendly cancel links for your Rails forms

Let your users opt out of a form and return to the page they came from with this simple helper. (June 16, 2011)

Better SMTP handling in Rails application development

You don't need to send out e-mail messages to real addresses during development with these two easy-to-use options for SMTP handling. (May 26, 2011)

Install Rails 3.1 beta with RVM gemsets (a public service announcement)

Don't forget, RVM gemsets are great for trying out pre-release versions of Rails without interfering with other work. Here's a reminder on how to set that up. (May 08, 2011)

try(), try() again in Rails

The very convenient try() method has been available to Rails developers since version 2.3, but it's easy to forget if you're not in the habit of using it. Here's a brief primer. (April 28, 2011)

Simple Rails site backups

How do you back up production data for your Rails projects? A new gem called Backup may be all you need. (April 03, 2011)

Obfuscated URLs with the FriendlyId gem

SEO-friendly URLs are great, but what if you want to obfuscate things a bit? Here's a proof of concept of one way to get the job done with the FriendlyId gem. (March 11, 2011)

Application templates in Rails 3

Here are some thoughts on bootstrapping Rails 3 apps with customized templates. (February 28, 2011)

Passenger 3, RVM, and Apache; quick and easy

If, like me, you've been dragging your feet about upgrading to Passenger 3, stop waiting. In this post I'll quickly walk through using it with RVM for Rails development. (January 25, 2011)

Learning Ruby and Rails

There's been a lot of conversation recently about the best ways to get started with Ruby. Here's my take on the subject, based on how I learned Ruby back in 2005 and what I'd do differently today. (January 19, 2011)

Beginning Rails testing

Still not writing tests for your Rails applications? Here are a few suggestions from my own experiences to get you started. (January 11, 2011)

Turnkey administration interface for your Rails apps

RailsAdmin gives you a rich, web-based interface to your Rails 3 application's data in minutes. Here's how to get started. (December 17, 2010)

Clean, search-friendly URLs for your Rails applications

Finding objects by nice-looking, search engine-friendly string parameters instead of the default object ID is easy with these Ruby gems. (December 07, 2010)

Trees and taxonomies with Ancestry

Ancestry is a new gem for adding tree structures to content in your Rails applications. (November 16, 2010)

jQuery Mobile, Rails, and Devise

jQuery Mobile is easy to integrate with Rails and Devise to create authenticated, mobile-friendly web applications. (November 09, 2010)

3 Rails documentation tools

Even in Rails, documenting your code is important. It's also pretty easy with these tools. (October 16, 2010)

3 Rails refactoring tools

Refactoring a Rails project can be a daunting task for new developers. Here are three tools to help ease the pain. (September 27, 2010)

RVM and project-specific gemsets in Rails

Take advantage of RVM's gemset feature to create project-specific gem installations for your Rails applications. (September 13, 2010)

Mobile Rails applications, part 2: jQTouch with Rails 3

Continuing on my project to build a mobile-friendly Rails application, here's a look at making the jQTouch mobile framework talk to your Rails application. (August 29, 2010)

Mobile Rails applications, part 1: An overview

Looking for the best way to make a mobile-optimized version of your website? Here are three resources to get you started, and a look at next steps. (August 22, 2010)

Parsing dates and times in Ruby and Rails

Make dates, times, and durations friendlier to users with Chronic and Chronic Duration, two must-have gems for Rails developers. (August 11, 2010)

More free Ruby and Rails books

Looking for more free books to get better at Ruby and Rails? Here are six more titles for your digital bookshelf. (August 04, 2010)

Use Nifty Generators in Rails 3

The very handy Nifty Generators gem works in Rails 3 with a few minor usage changes. (July 30, 2010)

Build a virtual bookshelf of free Ruby and Rails books

You don't need to spend a lot of money to build a reference collection for Ruby and Rails. Here are some free books to help you become a better Rails developer. (July 28, 2010)

Know your Rails command line tools

There's no getting around the command line when it comes to developing Rails applications. Here are several resources to help you get the most out of the Rails command line experience. (July 23, 2010)

Understanding REST and routes

These four tutorials will get you up to speed quickly on the ins and outs of RESTful routing in Rails. (July 18, 2010)

Nest routes through multiple controllers to DRY up your code

Want to nest an #index action under multiple parent scaffolds? It's actually pretty easy; this tutorial explains how. (July 13, 2010)

Authenticated attachments in Rails with Paperclip

Thoughtbot's Paperclip gem makes uploading files through web forms a breeze, but sometimes you need to keep those files protected from the general public. Here's how I require authenticated access to uploaded files in my Rails apps. Updated July 10, 2010. (July 08, 2010)

Moving from beginner to intermediate Rails development

So you've watched the podcasts, read the books, done the tutorials, and written your own Rails app. What's next? (July 05, 2010)

Stop procrastinating and install Rails 3 now with RVM

Worried about Rails 3 disrupting your workflow? Here's how I use RVM's gemsets feature to keep my day-to-day development environment and Rails 3 distinct. (June 28, 2010)

Adding authorization to your Rails app with RESTful_ACL, part 3: Parent and child objects

Leverage your applications' model relationships to write complex, but clean, authorization rules. (June 24, 2010)

Adding authorization to your Rails app with RESTful_ACL, part 2: Basic ACLs

Here's how to protect your application's data through an easy-to-apply access control layer. (June 21, 2010)

Even faster application bootstrapping with You've Got Rails

Build a full-featured template for your Rails applications with a few mouse clicks. (June 19, 2010)

Adding authorization to your Rails app with RESTful_ACL, part 1: Setup

Need easy-to-use authorization in your application? Check out this useful alternative to other, better known options. (June 16, 2010)

Debugging Rails apps with Rails Footnotes

Rails Footnotes is a must-have gem for Rails developers of all skill levels. Here's how to get started with this invaluable debugging tool. (June 10, 2010)

Hacking Restful Authentication

Edit user accounts and add administrator users to your legacy Rails apps using the popular Restful Authentication login system. (June 08, 2010)

3 Rails authentication options

It's almost inevitable that your Rails application will ultimately need some sort of login mechanism to protect access to certain parts. This post begins a series of looks at various options for authorization in Rails. (June 06, 2010)

Finding the best time-saving gems for your Rails app with Ruby Toolbox

How do you find the best gems to add features to your applications? Save a lot of search time with a new-ish index of Ruby gems. (June 03, 2010)

Building Rails apps faster with Nifty Generators, part 3: nifty_scaffold

Scaffolds are great when you're learning Rails, but the nifty_scaffold generator makes them effective timesavers when you're working on an app. (June 01, 2010)

Building Rails apps faster with Nifty Generators, part 2: nifty_config

Nifty Generators does more than just view-related code; here's an easy way to create a global config file for your app. (May 27, 2010)

Building Rails apps faster with Nifty Generators, part 1: nifty_layout

Nifty Generators make scaffolding in Rails an even more effective way to get your Rails app off the ground quickly. Here's how I use this handy gem to create a basic layout and stylesheet for my app. (May 25, 2010)

Bootstrapping Rails with an app template

Now that you've seen how I configure my Rails applications out of the gate, here's a way to do the same thing with one command. (May 22, 2010)

Bootstrapping a Rails application

The process of creating a new Rails application is straight from Rails 101, but there are a few steps you can add early on to help you code more efficiently down the road. (May 19, 2010)

Test with confidence!

If you liked my series on practical advice for adding reliable tests to your Rails apps, check out the expanded ebook version. Lots of additional, exclusive content and a complete sample Rails application.

Newsletter

Ruby on Rails news and tips, and other ideas and surprises from Aaron at Everyday Rails. Delivered to your inbox on no particular set schedule.