rubyonrails Archive

Testing Legacy Rails Code

Switching to Test-Driven Development (TDD) on an existing project without tests presents special challenges. Code could be a tangled mess of dependencies that defeats the very concept of unit testing. Or somebody attempted TDD in the past

Javascript Testing in Rails

This short tutorial explains how to use Jasmine to test JavaScript code in your Rails applications.

Learning TDD through Test-first Teaching

How to get started with TDD? Test-First Teaching is an innovative teaching approach that is gaining widespread adoption. Sarah Allen talks about how she teaches Ruby and Rails through a test-first approach. She demonstrates test-first teaching and

Railscasts – Model Versioning

If you need to keep track of a model’s history of changes and switch between versions, consider using the vestal_versions gem like I show in this episode. http://railscasts.com/episodes/177-model-versioning

Don’t Mock Yourself Out

Ask experienced Rails developers what they think about mock objects and some will say “absolutely awesome” while others “absolutely horrible.” The problem with both of those answers lies their “absolute”-ness. Used appropriately, mock objects are a powerful