engineering perfection on rails

test driving ruby on rails

If you know Ruby & Rails but don't know how to test drive your rails applications this workshop is for you. At the end of this workshop you should be able to:

  • Configure a Rails project to use Rspec for testing
  • Use RSpec to independently specify models, views, controllers and helpers
  • User special RSpec matchers for even more readable specs
  • Decide when to use mocks and when not to
  • Use tools like spork and parallel-tests to reduce build times
  • Use factory_girl to make your specs concise
  • Mock third party API calls without making the tests too brittle

Like all other workshops we conduct; this workshop is a collection of 20-30 minutes exercises, each concentrating on a particular topic, during which the attendee will test drive an application touching common aspects of the rails framework.

topics covered

While we assume that the attendee has a basic understanding of Rails and TDD, we will nevertheless cover the basics to make sure we are all on the same page. The introductory topics covered will be:

  • Red, Green and Refactor
  • Guidelines to write good specs
  • Simplest implementation first
  • Various ways to DRY the specs

Test driving various aspects of a Rails application:

  • Models
  • Controllers
  • Routes
  • Mailers
  • Views

Discussions over general topics, such as:

  • Rails inbuilt support for testing
  • Various rails environments and how to use them
  • Unit Testing vs Functional Testing vs Integration Testing

Edge cases for Rails application testing:

  • Testing ActiveResource clients
  • Testing Asynchronous code
  • Testing time based logic

Prerequisite: The attendees must have basic understanding of Ruby on Rails as well as TDD.