Sha256: 1062f46c49172681cc7d3a9b38d851dc96b643336cac2b696c0a0a0da8e03531

Contents?: true

Size: 1.62 KB

Versions: 41

Compression:

Stored size: 1.62 KB

Contents

require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")

module Braintree
  describe UsBankAccountVerificationSearch do
    context "verification method" do
      it "allows All verification methods" do
        search = UsBankAccountVerificationSearch.new

        lambda do
          search.verification_method.in(
            *Braintree::UsBankAccountVerification::VerificationMethod::All,
          )
        end.should_not raise_error
      end
    end

    context "id" do
      it "is" do
        search = UsBankAccountVerificationSearch.new
        search.id.is "v_id"

        search.to_hash.should == {:id => {:is => "v_id"}}
      end
    end

    context "ids" do
      it "correctly builds a hash with ids" do
        search = UsBankAccountVerificationSearch.new
        search.ids.in("id1", "id2")

        search.to_hash.should == {:ids => ["id1", "id2"]}
      end
    end

    context "account_holder_name" do
      it "is" do
        search = UsBankAccountVerificationSearch.new
        search.account_holder_name.is "v_account_holder_name"

        search.to_hash.should == {:account_holder_name => {:is => "v_account_holder_name"}}
      end
    end

    context "created_at" do
      it "is a range node" do
        search = UsBankAccountVerificationSearch.new
        search.created_at.should be_kind_of(Braintree::AdvancedSearch::RangeNode)
      end
    end

    context "account number" do
      it "uses ends_with" do
        search = UsBankAccountVerificationSearch.new
        search.account_number.ends_with "1234"

        search.to_hash.should == {:account_number => {:ends_with => "1234"}}
      end
    end
  end
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
braintree-4.14.0 spec/unit/braintree/us_bank_account_verification_search_spec.rb
braintree-4.13.0 spec/unit/braintree/us_bank_account_verification_search_spec.rb
braintree-4.12.0 spec/unit/braintree/us_bank_account_verification_search_spec.rb
braintree-4.11.0 spec/unit/braintree/us_bank_account_verification_search_spec.rb
braintree-4.10.0 spec/unit/braintree/us_bank_account_verification_search_spec.rb
braintree-4.9.0 spec/unit/braintree/us_bank_account_verification_search_spec.rb
braintree-4.8.0 spec/unit/braintree/us_bank_account_verification_search_spec.rb
braintree-4.7.0 spec/unit/braintree/us_bank_account_verification_search_spec.rb
braintree-4.6.0 spec/unit/braintree/us_bank_account_verification_search_spec.rb
braintree-4.5.0 spec/unit/braintree/us_bank_account_verification_search_spec.rb
braintree-4.4.0 spec/unit/braintree/us_bank_account_verification_search_spec.rb
braintree-4.3.0 spec/unit/braintree/us_bank_account_verification_search_spec.rb
braintree-4.2.0 spec/unit/braintree/us_bank_account_verification_search_spec.rb
braintree-4.1.0 spec/unit/braintree/us_bank_account_verification_search_spec.rb
braintree-4.0.0 spec/unit/braintree/us_bank_account_verification_search_spec.rb
braintree-3.4.0 spec/unit/braintree/us_bank_account_verification_search_spec.rb
braintree-3.3.0 spec/unit/braintree/us_bank_account_verification_search_spec.rb
braintree-3.2.0 spec/unit/braintree/us_bank_account_verification_search_spec.rb
braintree-3.1.0 spec/unit/braintree/us_bank_account_verification_search_spec.rb
braintree-3.0.1 spec/unit/braintree/us_bank_account_verification_search_spec.rb