diff options
Diffstat (limited to 'users/test/support')
-rw-r--r-- | users/test/support/stub_record_helper.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/users/test/support/stub_record_helper.rb b/users/test/support/stub_record_helper.rb index 5bccb66..25138a0 100644 --- a/users/test/support/stub_record_helper.rb +++ b/users/test/support/stub_record_helper.rb @@ -1,7 +1,7 @@ module StubRecordHelper # - # We will stub find_by_param or find_by_id to be called on klass and + # We will stub find when called on the records class and # return the record given. # # If no record is given but a hash or nil will create a stub based on @@ -10,8 +10,9 @@ module StubRecordHelper def find_record(factory, record_or_attribs_hash = {}) record = stub_record factory, record_or_attribs_hash, true klass = record.class - finder = klass.respond_to?(:find_by_param) ? :find_by_param : :find - klass.stubs(finder).with(record.to_param.to_s).returns(record) + # find is just an alias for get with CouchRest Model + klass.stubs(:get).with(record.to_param.to_s).returns(record) + klass.stubs(:find).with(record.to_param.to_s).returns(record) return record end |