lib/frenetic/concerns/member_rest_methods.rb in frenetic-0.0.20.alpha.4 vs lib/frenetic/concerns/member_rest_methods.rb in frenetic-0.0.20.alpha.5
- old
+ new
@@ -3,18 +3,22 @@
class Frenetic
module MemberRestMethods
extend ActiveSupport::Concern
module ClassMethods
- def find( params = {} )
+ def find( params )
params = { id:params } unless params.is_a? Hash
+ return as_mock(params) if test_mode?
+
if response = api.get( member_url(params) ) and response.success?
new response.body
end
end
def all
+ return [] if test_mode?
+
if response = api.get( collection_url ) and response.success?
Frenetic::ResourceCollection.new self, response.body
end
end
end
\ No newline at end of file