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.89.0 spec/unit/braintree/transaction_search_spec.rb
braintree-2.88.0 spec/unit/braintree/transaction_search_spec.rb
braintree-2.87.0 spec/unit/braintree/transaction_search_spec.rb
braintree-2.86.0 spec/unit/braintree/transaction_search_spec.rb
braintree-2.85.0 spec/unit/braintree/transaction_search_spec.rb
braintree-2.84.0 spec/unit/braintree/transaction_search_spec.rb
braintree-2.83.0 spec/unit/braintree/transaction_search_spec.rb
braintree-2.82.0 spec/unit/braintree/transaction_search_spec.rb
braintree-2.81.0 spec/unit/braintree/transaction_search_spec.rb
braintree-2.80.1 spec/unit/braintree/transaction_search_spec.rb
braintree-2.80.0 spec/unit/braintree/transaction_search_spec.rb
braintree-2.79.0 spec/unit/braintree/transaction_search_spec.rb
braintree-2.78.0 spec/unit/braintree/transaction_search_spec.rb
braintree-2.77.0 spec/unit/braintree/transaction_search_spec.rb
braintree-2.76.0 spec/unit/braintree/transaction_search_spec.rb
braintree-2.75.0 spec/unit/braintree/transaction_search_spec.rb
braintree-2.74.0 spec/unit/braintree/transaction_search_spec.rb
braintree-2.73.0 spec/unit/braintree/transaction_search_spec.rb
braintree-2.72.0 spec/unit/braintree/transaction_search_spec.rb
braintree-2.71.0 spec/unit/braintree/transaction_search_spec.rb