1
0
Fork 0
mirror of https://github.com/aasm/aasm synced 2023-03-27 23:22:41 -04:00

Fix transition test to not pass args

This fixes the negative case to actually test the negative case, instead
of the positive case.
This commit is contained in:
Donald Plummer 2013-11-20 15:18:35 -08:00
parent ecb0f28877
commit 67e1d23046

View file

@ -187,13 +187,13 @@ describe AASM::Transition, '- when executing the transition with an :on_transtio
args = {:arg1 => '1', :arg2 => '2'}
obj = double('object')
obj.class.class_eval do
define_method(:test) {|*args| 'success'}
def obj.test(args)
"arg1: #{args[:arg1]} arg2: #{args[:arg2]}"
end
return_value = st.execute(obj, args)
return_value.should == 'success'
return_value.should == 'arg1: 1 arg2: 2'
end
it 'should NOT pass args if the target method does NOT accept them' do
@ -202,8 +202,8 @@ describe AASM::Transition, '- when executing the transition with an :on_transtio
args = {:arg1 => '1', :arg2 => '2'}
obj = double('object')
obj.class.class_eval do
define_method(:test) {|*args| 'success'}
def obj.test
'success'
end
return_value = st.execute(obj, args)