[rspec-users] How do we test a Rails Model which does not have an equivalent table in the backend using RSpec
lists at ruby-forum.com
Mon Nov 21 21:11:08 EST 2011
Sidu Ponnappa wrote in post #1032900:
>> 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
> 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.
Thanks for your inputs Sidu,I tried replacing ActiveRecord with
ActiveModel got the following error:-
warning: already initialized constant HTTP_METHODS
(required)>': uninitialized constant ActiveModel::Base (NameError)
Seems like, I will have to look for another workaround..
Posted via http://www.ruby-forum.com/.
More information about the rspec-users