Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ActionController::TestCase vs ActiveSupport::TestCase; What exactly is the difference?

I assume that ActionController::TestCase is for only testing ActionControllers, but what does ActiveSupport::TestCase test? Does it test everything (models, views, and controllers)? Is one or both of these classes old/outdated? I think I prefer to stick with the stock RoR way of testing rather than getting more confused with other gems etc. I'm new to Ruby on Rails and TDD.

like image 381
NeilMonday Avatar asked Nov 15 '11 19:11

NeilMonday


1 Answers

ActionController::TestCase is designed for testing controllers, so it has special methods for testing controllers.
ActiveSupport::TestCase is designed for testing models.
there is api for these classes
http://api.rubyonrails.org/classes/ActionController/TestCase.html http://api.rubyonrails.org/classes/ActiveSupport/TestCase.html

like image 140
beornborn Avatar answered Sep 27 '22 00:09

beornborn