Sha256: 464a86cc10215dac6c738b01d501c0b0267bf2a3462a02a54a8aac582eee7daa

Contents?: true

Size: 1.6 KB

Versions: 112

Compression:

Stored size: 1.6 KB

Contents

require "spec_helper"

describe ChargeBee::ListResult do
  let(:response) do
    {:list=>
      [{:customer=>
         {:id=>"d0cus3orh6gnjgha1i",
          :first_name=>"Test Name1",
          :last_name=>"Test last name 1",
          :email=>"name1@gmail.com",
          :auto_collection=>"on",
          :created_at=>1346258514,
          :object=>"customer",
          :card_status=>"valid"},
        :card=>
         {:customer_id=>"d0cus3orh6gnjgha1i",
          :status=>"valid",
          :gateway=>"chargebee",
          :first_name=>"Test Name1",
          :last_name=>"Test last name 1",
          :iin=>"32122",
          :last4=>"1333",
          :card_type=>"visa",
          :expiry_month=>8,
          :expiry_year=>2013,
          :billing_addr1=>"Flat 11",
          :billing_addr2=>"51 Strit",
          :billing_city=>"Bristol",
          :billing_state=>"Somerset",
          :billing_zip=>"BS1 4HQ",
          :object=>"card",
          :masked_number=>"21323****4323"}},
       {:customer=>
         {:id=>"cwtid6smh67tq3z51l",
          :first_name=>"Test Name 2",
          :last_name=>"Test last name 2",
          :email=>"name2@gmail.com",
          :auto_collection=>"on",
          :created_at=>1345724673,
          :object=>"customer",
          :card_status=>"no_card"}}],
     :next_offset=>"[\"1345724673000\",\"1510\"]"}
  end

  before do
    ChargeBee::Rest.stubs(:request).returns(response)
  end

  it "returns list object, with next offset attribute" do
    list = ChargeBee::Request.send(:customer, "http://url.com", {:limit => 2})
    list.next_offset.should =~ ["1345724673000", "1510"]
  end
end

Version data entries

112 entries across 112 versions & 1 rubygems

Version Path
chargebee-2.12.0 spec/chargebee/list_result_spec.rb
chargebee-2.6.2 spec/chargebee/list_result_spec.rb
chargebee-2.6.1 spec/chargebee/list_result_spec.rb
chargebee-2.6.0 spec/chargebee/list_result_spec.rb
chargebee-2.5.9 spec/chargebee/list_result_spec.rb
chargebee-2.5.8 spec/chargebee/list_result_spec.rb
chargebee-2.5.7 spec/chargebee/list_result_spec.rb
chargebee-2.5.6 spec/chargebee/list_result_spec.rb
chargebee-2.5.5 spec/chargebee/list_result_spec.rb
chargebee-2.5.4 spec/chargebee/list_result_spec.rb
chargebee-2.5.3 spec/chargebee/list_result_spec.rb
chargebee-2.5.2 spec/chargebee/list_result_spec.rb
chargebee-2.5.0 spec/chargebee/list_result_spec.rb
chargebee-2.4.9 spec/chargebee/list_result_spec.rb
chargebee-2.4.8 spec/chargebee/list_result_spec.rb
chargebee-2.4.7 spec/chargebee/list_result_spec.rb
chargebee-2.4.6 spec/chargebee/list_result_spec.rb
chargebee-2.4.5 spec/chargebee/list_result_spec.rb
chargebee-2.4.4 spec/chargebee/list_result_spec.rb
chargebee-2.4.3 spec/chargebee/list_result_spec.rb