Sha256: 014931da860ca8d382397dac22a0f230817a1eb363ccc2c946fd906bb3326216

Contents?: true

Size: 909 Bytes

Versions: 7

Compression:

Stored size: 909 Bytes

Contents

require 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

7 entries across 7 versions & 1 rubygems

Version Path
braintree-2.6.0 spec/unit/braintree/transaction_search_spec.rb
braintree-2.5.2 spec/unit/braintree/transaction_search_spec.rb
braintree-2.5.1 spec/unit/braintree/transaction_search_spec.rb
braintree-2.4.0 spec/unit/braintree/transaction_search_spec.rb
braintree-2.3.1 spec/unit/braintree/transaction_search_spec.rb
braintree-2.2.0 spec/unit/braintree/transaction_search_spec.rb
braintree-2.1.0 spec/unit/braintree/transaction_search_spec.rb