From 7bb1a16d4eee3eb3ef36c6f5b4fc7968e3da7dd6 Mon Sep 17 00:00:00 2001 From: Azul Date: Wed, 28 Aug 2013 11:53:58 +0200 Subject: there's no need for User#find_by_param. clean it up --- users/test/support/stub_record_helper.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'users/test/support') 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 -- cgit v1.2.3