summaryrefslogtreecommitdiff
path: root/users/test/support/stub_record_helper.rb
diff options
context:
space:
mode:
authorjessib <jessib@riseup.net>2013-09-02 09:59:49 -0700
committerjessib <jessib@riseup.net>2013-09-02 09:59:49 -0700
commit6110093e939db07fd27fac7c28ddcd09a49e70ed (patch)
tree4393c3e8fcb2969b0bd21800bff7dd5a1fc9c3d7 /users/test/support/stub_record_helper.rb
parent060e06daa065f02b811dfe12850b101a62c12c8d (diff)
parent77af7ac953fb22c181056e8c40c8749d12a63922 (diff)
Merge pull request #74 from azul/refactor/finding-users
there's no need for User#find_by_param. clean it up
Diffstat (limited to 'users/test/support/stub_record_helper.rb')
-rw-r--r--users/test/support/stub_record_helper.rb7
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