diff options
author | Azul <azul@leap.se> | 2013-08-28 11:53:58 +0200 |
---|---|---|
committer | Azul <azul@leap.se> | 2013-08-30 14:54:30 +0200 |
commit | 7bb1a16d4eee3eb3ef36c6f5b4fc7968e3da7dd6 (patch) | |
tree | 75df9def4e9289b5373cea6108616405896491e1 /users/test/support | |
parent | 060e06daa065f02b811dfe12850b101a62c12c8d (diff) |
there's no need for User#find_by_param. clean it up
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 |