test/unit/ut_7_workitem.rb in ruote-2.1.9 vs test/unit/ut_7_workitem.rb in ruote-2.1.10

- old
+ new

@@ -42,7 +42,30 @@ assert_equal 'Singapore-La', w0.lf('customer.address.1') w0.set_field('customer.address', [ 'Cornwall Square 10b', 'Singapore-La' ]) assert_equal 'Cornwall Square 10b', w0.lookup('customer.address.0') end + + #def test_indifferent_access + # w0 = Ruote::Workitem.new( + # 'fields' => { 'customer' => 'john' }) + # assert_equal 'john', w0.fields['customer'] + # assert_equal 'john', w0.fields[:customer] + #end + + def test_sid + + f0 = { 'expid' => '0', 'wfid' => '20101224-baba', 'engine_id' => 'engine' } + w0 = Ruote::Workitem.new('fei' => f0, 'fields' => { 'a' => 'A' }) + + assert_equal '0!!20101224-baba', w0.sid + end + + def test_wfid + + f0 = { 'expid' => '0', 'wfid' => '20101224-baba', 'engine_id' => 'engine' } + w0 = Ruote::Workitem.new('fei' => f0, 'fields' => { 'a' => 'A' }) + + assert_equal '20101224-baba', w0.wfid + end end