Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 78fc0a6

Browse files
committedAug 31, 2016
Make coupon subcodes findable
The previous code was able to find coupons by code, but there was no way to find them by their subcodes.
1 parent cc54438 commit 78fc0a6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
 

‎lib/chargify_api_ares/resources/coupon.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def self.find_all_by_product_family_id(product_family_id)
77
end
88

99
def self.find_by_product_family_id_and_code(product_family_id, code)
10-
find(:one, :from => :lookup, :params => {:product_family_id => product_family_id, :code => code})
10+
find(:one, :from => :find, :params => {:product_family_id => product_family_id, :code => code})
1111
end
1212

1313
def self.validate(params = {})

‎spec/resources/coupon_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
let(:existing_coupon) { build(:coupon, :code => '20OFF') }
66

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

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

0 commit comments

Comments
 (0)
Please sign in to comment.