spec/integration/braintree/subscription_spec.rb in braintree-1.2.1 vs spec/integration/braintree/subscription_spec.rb in braintree-2.0.0
- old
+ new
@@ -417,15 +417,15 @@
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.items.size.should == 0
+ collection._approximate_size.should == 0
end
context "is statement" do
- it "returns paged collection with matching results" do
+ it "returns resource collection with matching results" do
trialless_subscription = Braintree::Subscription.create(
:payment_method_token => @credit_card.token,
:plan_id => TriallessPlan[:id]
).subscription
@@ -436,17 +436,17 @@
collection = Braintree::Subscription.search do |search|
search.plan_id.is TriallessPlan[:id]
end
- collection.should include_on_any_page(trialless_subscription)
- collection.should_not include_on_any_page(trial_subscription)
+ collection.should include(trialless_subscription)
+ collection.should_not include(trial_subscription)
end
end
context "is_not statement" do
- it "returns paged collection without matching results" do
+ it "returns resource collection without matching results" do
trialless_subscription = Braintree::Subscription.create(
:payment_method_token => @credit_card.token,
:plan_id => TriallessPlan[:id]
).subscription
@@ -457,17 +457,17 @@
collection = Braintree::Subscription.search do |search|
search.plan_id.is_not TriallessPlan[:id]
end
- collection.should_not include_on_any_page(trialless_subscription)
- collection.should include_on_any_page(trial_subscription)
+ collection.should_not include(trialless_subscription)
+ collection.should include(trial_subscription)
end
end
context "ends_with statement" do
- it "returns paged collection with matching results" do
+ it "returns resource collection with matching results" do
trialless_subscription = Braintree::Subscription.create(
:payment_method_token => @credit_card.token,
:plan_id => TriallessPlan[:id]
).subscription
@@ -478,17 +478,17 @@
collection = Braintree::Subscription.search do |search|
search.plan_id.ends_with "trial_plan"
end
- collection.should include_on_any_page(trial_subscription)
- collection.should_not include_on_any_page(trialless_subscription)
+ collection.should include(trial_subscription)
+ collection.should_not include(trialless_subscription)
end
end
context "starts_with statement" do
- it "returns paged collection with matching results" do
+ it "returns resource collection with matching results" do
trialless_subscription = Braintree::Subscription.create(
:payment_method_token => @credit_card.token,
:plan_id => TriallessPlan[:id]
).subscription
@@ -499,17 +499,17 @@
collection = Braintree::Subscription.search do |search|
search.plan_id.starts_with "integration_trial_p"
end
- collection.should include_on_any_page(trial_subscription)
- collection.should_not include_on_any_page(trialless_subscription)
+ collection.should include(trial_subscription)
+ collection.should_not include(trialless_subscription)
end
end
context "contains statement" do
- it "returns paged collection with matching results" do
+ it "returns resource collection with matching results" do
trialless_subscription = Braintree::Subscription.create(
:payment_method_token => @credit_card.token,
:plan_id => TriallessPlan[:id]
).subscription
@@ -520,12 +520,12 @@
collection = Braintree::Subscription.search do |search|
search.plan_id.contains "trial_p"
end
- collection.should include_on_any_page(trial_subscription)
- collection.should_not include_on_any_page(trialless_subscription)
+ collection.should include(trial_subscription)
+ collection.should_not include(trialless_subscription)
end
end
end
context "multiple_value_fields" do
@@ -545,12 +545,12 @@
collection = Braintree::Subscription.search do |search|
search.plan_id.is TriallessPlan[:id]
end
- collection.should include_on_any_page(subscription1)
- collection.should include_on_any_page(subscription2)
+ collection.should include(subscription1)
+ collection.should include(subscription2)
end
it "returns only matching results" do
subscription1 = Braintree::Subscription.create(
:payment_method_token => @credit_card.token,
@@ -566,12 +566,12 @@
collection = Braintree::Subscription.search do |search|
search.status.in Braintree::Subscription::Status::Active
end
- collection.should include_on_any_page(subscription1)
- collection.should_not include_on_any_page(subscription2)
+ collection.should include(subscription1)
+ collection.should_not include(subscription2)
end
it "returns only matching results given an argument list" do
subscription1 = Braintree::Subscription.create(
:payment_method_token => @credit_card.token,
@@ -587,12 +587,12 @@
collection = Braintree::Subscription.search do |search|
search.status.in Braintree::Subscription::Status::Active, Braintree::Subscription::Status::Canceled
end
- collection.should include_on_any_page(subscription1)
- collection.should include_on_any_page(subscription2)
+ collection.should include(subscription1)
+ collection.should include(subscription2)
end
it "returns only matching results given an array" do
subscription1 = Braintree::Subscription.create(
:payment_method_token => @credit_card.token,
@@ -608,11 +608,11 @@
collection = Braintree::Subscription.search do |search|
search.status.in [Braintree::Subscription::Status::Active, Braintree::Subscription::Status::Canceled]
end
- collection.should include_on_any_page(subscription1)
- collection.should include_on_any_page(subscription2)
+ collection.should include(subscription1)
+ collection.should include(subscription2)
end
end
end
end
end