# Advice for tests

**URL:** <https://www.ruby-forum.com/t/advice-for-tests/193783>\
**Category:** Rails\
**Created:** [August 24, 2010, 10:50am UTC](https://www.ruby-forum.com/t/advice-for-tests/193783 "2010-08-24T10:50:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![msan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/3ab097/32.png) [@msan](https://www.ruby-forum.com/u/msan)\
**Post date:** [August 24, 2010, 10:50am UTC](https://www.ruby-forum.com/t/advice-for-tests/193783/1 "2010-08-24T10:50:17Z")

</div>

Hallo.  
I’m using rails with jruby for my applications but until now I never  
used tests.  
Now I want start to integrate tests during my applications development.  
Do you suggest some suites or frameworks to automate and facilitate  
tests?  
I’ve heard of selenium [http://seleniumhq.org](http://seleniumhq.org).  
What do you think about?

---

<div class="post-metadata">

**Author:** ![msan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/3ab097/32.png) [@msan](https://www.ruby-forum.com/u/msan)\
**Post date:** [August 24, 2010, 11:03am UTC](https://www.ruby-forum.com/t/advice-for-tests/193783/2 "2010-08-24T11:03:10Z")

</div>

On 24 Aug 2010, at 10:48, Mauro wrote:

> I’m using rails with jruby for my applications but until now I never  
> used tests.  
> Now I want start to integrate tests during my applications  
> development.  
> Do you suggest some suites or frameworks to automate and facilitate  
> tests?  
> I’ve heard of selenium [http://seleniumhq.org](http://seleniumhq.org).  
> What do you think about?

Basically there’s two to three tiers of tests you’d want to look into:

- unit tests: testing models on a microlevel, making sure that your  
models behave and will keep behaving as you intend them to. Personally  
I prefer RSpec for these tests, the syntax feels natural to me.  
However, you could also use Test::Unit with Shoulda. There’s probably  
some other options available, but these two are going to be the most  
popular ones.

- integration tests: testing controllers and the actual application  
behavior. Now this is where Selenium comes in. Unless your Rails app  
makes extensive use of clientside technology (i.e. Javascript and AJAX  
requests), you probably don’t need Selenium. Don’t use Selenium as a  
way to press a record button and go through your application manually  
and then replay that every now and then. We use Cucumber+Selenium for  
our application because quite a bit of the functionality is clientside  
code. If that weren’t the case, Cucumber by itself would be more than  
enough. You basically write different scenarios and then run them.

- performance tests: here you will tests the performance of your Rails  
app. Personally I’ve never needed to use them, so maybe someone will  
chime in here on what solutions are available.

[Peepcode.com](http://Peepcode.com) has some really nice screencasts available on testing.

Best regards

Peter De Berdt
