Everyday Rails

Articles tagged rspec

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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.