# Ruby on Rails testing

**URL:** <https://www.ruby-forum.com/t/ruby-on-rails-testing/154474>\
**Category:** Rails\
**Created:** [November 30, 2008, 10:25am UTC](https://www.ruby-forum.com/t/ruby-on-rails-testing/154474 "2008-11-30T10:25:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![alex](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/db5fbb/32.png) [@alex](https://www.ruby-forum.com/u/alex)\
**Post date:** [November 30, 2008, 10:25am UTC](https://www.ruby-forum.com/t/ruby-on-rails-testing/154474/1 "2008-11-30T10:25:55Z")

</div>

What is the upside to testing in Ruby on Rails? I’m learning Rails and  
it seems like it’s a waste of time to write code for something you  
could test yourself…

---

<div class="post-metadata">

**Author:** ![alex](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/db5fbb/32.png) [@alex](https://www.ruby-forum.com/u/alex)\
**Post date:** [November 30, 2008, 10:28am UTC](https://www.ruby-forum.com/t/ruby-on-rails-testing/154474/2 "2008-11-30T10:28:52Z")

</div>

On Nov 30, 5:11 am, alex [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> What is the upside to testing in Ruby on Rails? I’m learning Rails and  
> it seems like it’s a waste of time to write code for something you  
> could test yourself…

Will you automatically repeat all of your tests everytime you change  
the slightest bit of code?  
In my opinion automated unit tests are one of the most invaluable  
safeguards you can have.

Fred

---

<div class="post-metadata">

**Author:** ![alex](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/db5fbb/32.png) [@alex](https://www.ruby-forum.com/u/alex)\
**Post date:** [November 30, 2008, 12:01pm UTC](https://www.ruby-forum.com/t/ruby-on-rails-testing/154474/3 "2008-11-30T12:01:31Z")

</div>

alex wrote:

> What is the upside to testing in Ruby on Rails? I’m learning Rails and  
> it seems like it’s a waste of time to write code for something you  
> could test yourself…

I can test all the important parts of my app in 21 seconds. That’s less  
time that it usually takes me to test just one thing by hand. If I had  
to test all these features myself every time I made a change that  
_might_ break something (which is pretty much every change), then I’d be  
spending 90% of my time clicking around in a web browser. Instead I  
spend just half my time in a test directory.

---

<div class="post-metadata">

**Author:** ![alex](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/db5fbb/32.png) [@alex](https://www.ruby-forum.com/u/alex)\
**Post date:** [November 30, 2008, 12:23pm UTC](https://www.ruby-forum.com/t/ruby-on-rails-testing/154474/4 "2008-11-30T12:23:45Z")

</div>

Write tests, write code.

Later:

Write code, break tests.

This is the part that saves your ass because if you’re deploying  
WITHOUT tests you’re probably thinking “MY APP IS BULLETPROOF” when  
actually it’s “BULLET RIDDEN”. So, if you have tests you’ll see that  
something is FUBAR’d and you’ll really want to fix that before  
deploying, therefore making you feel great that you’re doing a little  
work to keep the world safe and your clients happy that their  
application is not broken.

* * *

Ryan B.  
Freelancer

> **[frozenplague.net](http://frozenplague.net)**
>
> This domain may be for sale!
