Permalink
Browse files

Complex object data should not be requested directly within parent qu…

…eries
  • Loading branch information...
1 parent 5127c1b commit b169d4e9f12048011f7ee2c5f4ee333471866447 Josh Martin committed Mar 1, 2012
Showing with 9 additions and 0 deletions.
  1. +1 −0 lib/zuora/objects/base.rb
  2. +8 −0 spec/zuora/objects/product_rate_plan_charge_spec.rb
@@ -76,6 +76,7 @@ def reload!
end
def self.unselectable_attributes
+ class_variable_get(:@@complex_attributes).keys +
class_variable_get(:@@write_only_attributes) +
class_variable_get(:@@deferred_attributes)
end
@@ -25,6 +25,14 @@
xml.should have_xml("//env:Body/#{zns}:query/#{zns}:queryString").
with_value(/select .+ from ProductRatePlanChargeTier where ProductRatePlanChargeId = 'test'/)
end
+
+ it "should not include complex attributes in the request" do
+ MockResponse.responds_with(:product_rate_plan_charge_tier_find_success) do
+ subject.class.find('example')
+ end
+ xml = Zuora::Api.instance.last_request
+ xml.should_not =~ /ProductRatePlanChargeTierData/
+ end
end
it 'can create a product rate plan with several charge tiers' do

0 comments on commit b169d4e

Please sign in to comment.