1 | require File.dirname(__FILE__) + '/../../../../../../spec_helper'
|
---|
2 | include OpenEHR::RM::Composition::Content::Entry
|
---|
3 | include OpenEHR::RM::DataTypes::Text
|
---|
4 |
|
---|
5 | describe IsmTransition do
|
---|
6 | before(:each) do
|
---|
7 | current_state = stub(DvCodedText, :value => 'planned')
|
---|
8 | transition = stub(DvCodedText, :value => 'scheduled')
|
---|
9 | careflow_step = stub(DvCodedText, :value => 'completed')
|
---|
10 | @ism_transition = IsmTransition.new(:current_state => current_state,
|
---|
11 | :transition => transition,
|
---|
12 | :careflow_step => careflow_step)
|
---|
13 | end
|
---|
14 |
|
---|
15 | it 'should be an instance of IsmTransition' do
|
---|
16 | @ism_transition.should be_an_instance_of IsmTransition
|
---|
17 | end
|
---|
18 |
|
---|
19 | it 'current_status should be assigned properly' do
|
---|
20 | @ism_transition.current_state.value.should == 'planned'
|
---|
21 | end
|
---|
22 |
|
---|
23 | it 'should raise ArgumentError with nil current state' do
|
---|
24 | lambda {
|
---|
25 | @ism_transition.current_state = nil
|
---|
26 | }.should raise_error ArgumentError
|
---|
27 | end
|
---|
28 |
|
---|
29 | it 'should raise ArgumentError when current_state has invalid code'
|
---|
30 |
|
---|
31 | it 'transition should be assined properly' do
|
---|
32 | @ism_transition.transition.value.should == 'scheduled'
|
---|
33 | end
|
---|
34 |
|
---|
35 | it 'should raise ArgumentError with nil transition' do
|
---|
36 | lambda {
|
---|
37 | @ism_transition.transition = nil
|
---|
38 | }.should raise_error ArgumentError
|
---|
39 | end
|
---|
40 |
|
---|
41 | it 'should raise ArugmentError with invalid transition code'
|
---|
42 |
|
---|
43 | it 'careflow_step should be assigned properly' do
|
---|
44 | @ism_transition.careflow_step.value.should == 'completed'
|
---|
45 | end
|
---|
46 | end
|
---|