spec/integration/braintree/customer_spec.rb in braintree-1.2.1 vs spec/integration/braintree/customer_spec.rb in braintree-2.0.0

- old
+ new

@@ -1,19 +1,15 @@ require File.dirname(__FILE__) + "/../spec_helper" describe Braintree::Customer do describe "self.all" do - it "returns page 1 if page isn't specified" do - first_page = Braintree::Customer.all - first_page.current_page_number.should == 1 - end + it "gets more than a page of customers" do + customers = Braintree::Customer.all + customers._approximate_size.should > 100 - it "can get the next_page" do - first_page = Braintree::Customer.all - first_page.current_page_number.should == 1 - second_page = first_page.next_page - second_page.current_page_number.should == 2 + customer_ids = customers.map {|c| c.id }.uniq.compact + customer_ids.size.should == customers._approximate_size end end describe "self.delete" do it "deletes the customer with the given id" do @@ -296,13 +292,11 @@ :expiration_date => "05/2010" } ) transaction = customer.sale!(:amount => "100.00") collection = Braintree::Customer.transactions(customer.id) - collection.current_page_number.should == 1 - collection.total_items.should == 1 - collection[0].should == transaction + collection.first.should == transaction end end describe "sale" do @@ -354,12 +348,10 @@ :expiration_date => "05/2010" } ) transaction = customer.sale!(:amount => "100.00") collection = customer.transactions - collection.current_page_number.should == 1 - collection.total_items.should == 1 - collection[0].should == transaction + collection.first.should == transaction end end describe "credit" do it "creates a credit transaction using the customer, returning a result object" do