spec/ib-ruby/models/order_spec.rb in ib-ruby-0.7.9 vs spec/ib-ruby/models/order_spec.rb in ib-ruby-0.7.10

- old
+ new

@@ -48,21 +48,22 @@ [:what_if, :not_held, :outside_rth, :hidden, :transmit, :block_order, :sweep_to_fill, :override_percentage_constraints, :all_or_none, :etrade_only, :firm_quote_only, :opt_out_smart_routing, :scale_auto_reset, :scale_random_percent] => boolean_assigns, + + [:local_id, :perm_id, :parent_id] => numeric_or_nil_assigns, } end let(:aliases) do {[:side, :action] => buy_sell_short_assigns, - [:local_id, :order_id] => numeric_or_nil_assigns, [:quantity, :total_quantity] => numeric_or_nil_assigns, } end - let(:associations) do + let(:collections) do {:order_states => [IB::OrderState.new(:status => :Foo), IB::OrderState.new(:status => 'Bar'),], :executions => [IB::Execution.new(:local_id => 23, :client_id => 1111, @@ -125,19 +126,20 @@ subject.max_commission.should be_nil subject.warning_text.should be_nil subject.init_margin.should be_nil subject.maint_margin.should be_nil subject.equity_with_loan.should be_nil - # Properties arriving via OrderStatus messagesubject. - subject.filled.should be_nil - subject.remaining.should be_nil - subject.price.should be_nil - subject.last_fill_price.should be_nil - subject.average_price.should be_nil - subject.average_fill_price.should be_nil + # Properties arriving via OrderStatus message + subject.filled.should == 0 + subject.remaining.should == 0 + subject.price.should == 0 + subject.last_fill_price.should == 0 + subject.average_price.should == 0 + subject.average_fill_price.should == 0 subject.why_held.should be_nil - # Testing Order statesubject. + # Testing Order state subject.should be_new + subject.should_not be_submitted subject.should_not be_pending subject.should be_active subject.should_not be_inactive subject.should_not be_complete_fill end