Sha256: 5cf627c0a2deb8de60f1a6e921a06f787198ef93620de5b118a662502b358830

Contents?: true

Size: 927 Bytes

Versions: 120

Compression:

Stored size: 927 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

120 entries across 120 versions & 1 rubygems

Version Path
braintree-2.33.1 spec/unit/braintree/transaction_search_spec.rb
braintree-2.33.0 spec/unit/braintree/transaction_search_spec.rb
braintree-2.32.1 spec/unit/braintree/transaction_search_spec.rb
braintree-2.31.0 spec/unit/braintree/transaction_search_spec.rb
braintree-2.30.2 spec/unit/braintree/transaction_search_spec.rb
braintree-2.30.0 spec/unit/braintree/transaction_search_spec.rb
braintree-2.29.0 spec/unit/braintree/transaction_search_spec.rb
braintree-2.28.0 spec/unit/braintree/transaction_search_spec.rb
braintree-2.27.1 spec/unit/braintree/transaction_search_spec.rb
braintree-2.27.0 spec/unit/braintree/transaction_search_spec.rb
braintree-2.26.0 spec/unit/braintree/transaction_search_spec.rb
braintree-2.25.0 spec/unit/braintree/transaction_search_spec.rb
braintree-2.24.0 spec/unit/braintree/transaction_search_spec.rb
braintree-2.23.0 spec/unit/braintree/transaction_search_spec.rb
braintree-2.22.0 spec/unit/braintree/transaction_search_spec.rb
braintree-2.21.0 spec/unit/braintree/transaction_search_spec.rb
braintree-2.20.0 spec/unit/braintree/transaction_search_spec.rb
braintree-2.19.0 spec/unit/braintree/transaction_search_spec.rb
braintree-2.18.0 spec/unit/braintree/transaction_search_spec.rb
braintree-2.17.0 spec/unit/braintree/transaction_search_spec.rb