Permalink
Browse files

Always return a collection from #find_all_by_user.

  • Loading branch information...
1 parent 5013965 commit 1c49575bcbcbddb77106d0cd201dfe367f389aac @tylerhunt tylerhunt committed Dec 12, 2012
Showing with 4 additions and 4 deletions.
  1. +2 −2 lib/etsy/shipping_template.rb
  2. +2 −2 test/unit/etsy/shipping_template_test.rb
@@ -10,7 +10,7 @@ def self.create(options = {})
options.merge!(:require_secure => true)
post("/shipping/templates", options)
end
-
+
def self.find(id, credentials = {})
options = {
:access_token => credentials[:access_token],
@@ -35,7 +35,7 @@ def self.find_all_by_user(credentials = {})
:access_secret => credentials[:access_secret],
:require_secure => true
}
- get("/users/__SELF__/shipping/templates", options)
+ get_all("/users/__SELF__/shipping/templates", options)
end
end
end
@@ -19,10 +19,10 @@ class ShippingTemplateTest < Test::Unit::TestCase
should "have an user_id" do
@shipping_template.user_id.should == 14888443
end
-
+
should "be able to list all templates from a user" do
options = { access_token: 'token', access_secret: 'secret' }
- ShippingTemplate.expects(:get).with('/users/__SELF__/shipping/templates', options.merge(require_secure: true))
+ ShippingTemplate.expects(:get_all).with('/users/__SELF__/shipping/templates', options.merge(require_secure: true))
ShippingTemplate.find_all_by_user(options)
end
end

0 comments on commit 1c49575

Please sign in to comment.