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.16.0 spec/unit/braintree/transaction_search_spec.rb
braintree-2.15.0 spec/unit/braintree/transaction_search_spec.rb
braintree-2.14.0 spec/unit/braintree/transaction_search_spec.rb
braintree-2.13.4 spec/unit/braintree/transaction_search_spec.rb
braintree-2.13.3 spec/unit/braintree/transaction_search_spec.rb
braintree-2.13.2 spec/unit/braintree/transaction_search_spec.rb
braintree-2.13.1 spec/unit/braintree/transaction_search_spec.rb
braintree-2.10.3 spec/unit/braintree/transaction_search_spec.rb
braintree-2.13.0 spec/unit/braintree/transaction_search_spec.rb
braintree-2.12.0 spec/unit/braintree/transaction_search_spec.rb
braintree-2.11.0 spec/unit/braintree/transaction_search_spec.rb
braintree-2.10.2 spec/unit/braintree/transaction_search_spec.rb
braintree-2.10.1 spec/unit/braintree/transaction_search_spec.rb
braintree-2.10.0 spec/unit/braintree/transaction_search_spec.rb
braintree-2.9.1 spec/unit/braintree/transaction_search_spec.rb
braintree-2.8.0 spec/unit/braintree/transaction_search_spec.rb
braintree-2.7.0 spec/unit/braintree/transaction_search_spec.rb
braintree-2.6.3 spec/unit/braintree/transaction_search_spec.rb
braintree-2.6.2 spec/unit/braintree/transaction_search_spec.rb
braintree-2.6.1 spec/unit/braintree/transaction_search_spec.rb