Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix timers with nil target rendering

closes gh-19

(Thanks Danny Fullerton)
  • Loading branch information...
commit 55bf5367875ec9e81a0ab62cfffb66f4335a064e 1 parent 9d653ea
@jmettraux jmettraux authored
View
1  CHANGELOG.txt
@@ -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
1  CREDITS.txt
@@ -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
View
14 lib/ruote-kit/helpers/json_helpers.rb
@@ -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
View
2  lib/ruote-kit/views/schedules.html.haml
@@ -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
View
20 spec/resources/schedules_spec.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.