[rspec-users] testing named_scope

Bogdan Gusiev lists at ruby-forum.com
Sat Aug 14 11:44:16 EDT 2010


Nin wrote:
> Hi! I'm new to rspec and was wondering how named_scopes are usually
> tested? Is it enough to test that it's defined? or do you need to test
> the behavior as well? I've been reading around and this seems to be
> the tester's choice, i just want to get people's opinion on this :D

Here is my approach: 
http://gusiev.com/2010/07/bdd-rspec-matcher-to-test-named_scope-scoped-rails-3/
It is a little advanced. Hopefully you will get the idea.
-- 
Posted via http://www.ruby-forum.com/.


More information about the rspec-users mailing list