bumbleworks 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/bumbleworks/task.rb +4 -0
- data/lib/bumbleworks/tasks/base.rb +6 -0
- data/lib/bumbleworks/version.rb +1 -1
- data/spec/lib/bumbleworks/task_spec.rb +10 -0
- metadata +1 -1
data/lib/bumbleworks/task.rb
CHANGED
@@ -118,7 +118,11 @@ module Bumbleworks
|
|
118
118
|
|
119
119
|
# proceed workitem (saving changes to fields)
|
120
120
|
def complete(params = {})
|
121
|
+
before_update(params)
|
122
|
+
before_complete(params)
|
121
123
|
proceed_workitem
|
124
|
+
after_complete(params)
|
125
|
+
after_update(params)
|
122
126
|
end
|
123
127
|
|
124
128
|
# Token used to claim task, nil if not claimed
|
data/lib/bumbleworks/version.rb
CHANGED
@@ -335,6 +335,16 @@ describe Bumbleworks::Task do
|
|
335
335
|
task.params['state'].should be_nil
|
336
336
|
task.fields['meal'].should == 'root beer and a kite'
|
337
337
|
end
|
338
|
+
|
339
|
+
it 'calls update and complete callbacks' do
|
340
|
+
task = described_class.new(workflow_item)
|
341
|
+
task.should_receive(:before_update).with(:argue_mints).ordered
|
342
|
+
task.should_receive(:before_complete).with(:argue_mints).ordered
|
343
|
+
task.should_receive(:proceed_workitem).ordered
|
344
|
+
task.should_receive(:after_complete).with(:argue_mints).ordered
|
345
|
+
task.should_receive(:after_update).with(:argue_mints).ordered
|
346
|
+
task.complete(:argue_mints)
|
347
|
+
end
|
338
348
|
end
|
339
349
|
|
340
350
|
describe '#has_entity_fields?' do
|