Permalink
Browse files

fix timers with nil target rendering

closes gh-19

(Thanks Danny Fullerton)
  • Loading branch information...
1 parent 9d653ea commit 55bf5367875ec9e81a0ab62cfffb66f4335a064e @jmettraux jmettraux committed Jun 18, 2012
View
@@ -4,6 +4,7 @@
== ruote-kit - 2.3.0 not yet released
+- fix timers with nil target rendering (Thanks Danny Fullerton)
- RuoteKit.worklist (alias to RuoteKit.store_participant)
- RuoteKit.dashboard (alias to RuoteKit.engine)
- ruote-fluo adapted to FF7 (mozDrawText -> fillText)
View
@@ -19,6 +19,7 @@
== Feedback
+- Danny Fullerton (timers not rendering (target nil))
- Eric Smith (broken 2.2.0.2)
- Nicolai Reuschling - https://github.com/codeblogger
- Frédéric Vanclef - https://github.com/fvanclef
@@ -114,12 +114,16 @@ def json_schedules
target_fei = sched.delete('target')
sched['owner'] = owner_fei.to_h
- sched['target'] = target_fei.to_h
+ sched['target'] = target_fei ? target_fei.to_h : nil
- sched['links'] = [
- hlink('expressions', owner_fei.sid, :rel => '#schedule_owner'),
- hlink('expressions', target_fei.sid, :rel => '#schedule_target')
- ]
+ sched['links'] = []
+
+ sched['links'] << hlink(
+ 'expressions', owner_fei.sid, :rel => '#schedule_owner'
+ )
+ sched['links'] << hlink(
+ 'expressions', target_fei.sid, :rel => '#schedule_target'
+ ) if target_fei
end
@schedules
@@ -26,7 +26,7 @@
%td
%div
= alink(:expressions, schedule['owner'].sid)
- - if schedule['owner'] != schedule['target']
+ - if schedule['target'] && schedule['target'] != schedule['owner']
%div
= alink(:expressions, schedule['target'].sid)
%td
@@ -93,6 +93,12 @@
end)
RuoteKit.engine.wait_for(:alpha)
+
+ @wfid2 = RuoteKit.engine.launch(Ruote.define do
+ bravo :timers => '1d: x, 2d: timeout'
+ end)
+
+ RuoteKit.engine.wait_for(:bravo)
end
it 'lists schedules (HTML)' do
@@ -112,6 +118,20 @@
last_response.json_body['schedules'].size.should == 1
end
+
+ it 'list schedules with timers (nil target) (HTML)' do
+
+ get "/_ruote/schedules/#{@wfid2}"
+
+ last_response.status.should be(200)
+ end
+
+ it 'list schedules with timers (nil target) (JSON)' do
+
+ get "/_ruote/schedules/#{@wfid2}.json"
+
+ last_response.status.should be(200)
+ end
end
end

0 comments on commit 55bf536

Please sign in to comment.