Sha256: 8c40c6e2a9ee50281d0dc7cf87580817c5256e4220cc114bb119540b93249db5

Contents?: true

Size: 947 Bytes

Versions: 16

Compression:

Stored size: 947 Bytes

Contents

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

describe Braintree::TransactionSearch do
  it "overrides previous 'is' with new 'is' for the same field" do
    search = Braintree::TransactionSearch.new
    search.billing_company.is "one"
    search.billing_company.is "two"
    search.to_hash.should == {:billing_company => {:is => "two"}}
  end

  it "overrides previous 'in' with new 'in' for the same field" do
    search = Braintree::TransactionSearch.new
    search.status.in Braintree::Transaction::Status::Authorized
    search.status.in Braintree::Transaction::Status::SubmittedForSettlement
    search.to_hash.should == {:status => [Braintree::Transaction::Status::SubmittedForSettlement]}
  end

  it "raises if the operator 'is' is left off" do
    search = Braintree::TransactionSearch.new
    expect do
      search.billing_company "one"
    end.to raise_error(RuntimeError, "An operator is required")
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

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