[rspec-users] How do we test a Rails Model which does not have an equivalent table in the backend using RSpec

Sidu Ponnappa ckponnappa at gmail.com
Mon Nov 21 08:07:58 EST 2011

> I'm getting a common error for all such defined methods saying that> `database_name.table_name does not exist`. Well , this is true but how> should is it really making a difference?, and how to get a work around> for this to just test a simple use case of calling a method successfully> in the above context.
I don't believe this issue has anything to do with RSpec (you'd see
the same if you used MiniTest or any other tool).

You want to have Moderator be a simple Ruby object, or possibly have
it inherit from ActiveModel rather than ActiveRecord.


More information about the rspec-users mailing list