Skip to content

Commit

Permalink
Merge pull request #140 from oboxodo/patch-1
Browse files Browse the repository at this point in the history
Make coupon subcodes findable
  • Loading branch information
mwhagedorn authored Aug 31, 2016
2 parents 0cda48c + 78fc0a6 commit 1febc13
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/chargify_api_ares/resources/coupon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def self.find_all_by_product_family_id(product_family_id)
end

def self.find_by_product_family_id_and_code(product_family_id, code)
find(:one, :from => :lookup, :params => {:product_family_id => product_family_id, :code => code})
find(:one, :from => :find, :params => {:product_family_id => product_family_id, :code => code})
end

def self.validate(params = {})
Expand Down
2 changes: 1 addition & 1 deletion spec/resources/coupon_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
let(:existing_coupon) { build(:coupon, :code => '20OFF') }

before(:each) do
FakeWeb.register_uri(:get, "#{test_domain}/coupons/lookup.xml?code=#{existing_coupon.code}&product_family_id=10", :body => existing_coupon.attributes.to_xml)
FakeWeb.register_uri(:get, "#{test_domain}/coupons/find.xml?code=#{existing_coupon.code}&product_family_id=10", :body => existing_coupon.attributes.to_xml)
end

it "finds the correct coupon by product family and code" do
Expand Down

0 comments on commit 1febc13

Please sign in to comment.