spec/integration/braintree/subscription_spec.rb in braintree-2.1.0 vs spec/integration/braintree/subscription_spec.rb in braintree-2.2.0

- old
+ new

@@ -414,11 +414,11 @@ it "correctly returns a result with no matches" do collection = Braintree::Subscription.search do |search| search.plan_id.is "not_a_real_plan_id" end - collection._approximate_size.should == 0 + collection.maximum_size.should == 0 end context "is statement" do it "returns resource collection with matching results" do trialless_subscription = Braintree::Subscription.create( @@ -610,9 +610,22 @@ collection.should include(subscription1) collection.should include(subscription2) end end end + + it "returns multiple results" do + (110 - Braintree::Subscription.search.maximum_size).times do + Braintree::Subscription.create(:payment_method_token => @credit_card.token, :plan_id => TriallessPlan[:id]) + end + + collection = Braintree::Subscription.search + collection.maximum_size.should > 100 + + subscriptions_ids = collection.map {|t| t.id }.uniq.compact + subscriptions_ids.size.should == collection.maximum_size + end + end describe "self.retry_charge" do it "is successful with only subscription id" do subscription = Braintree::Subscription.search do |search|