Skip to content
This repository has been archived by the owner on Mar 5, 2020. It is now read-only.

Commit

Permalink
WIP: /workitems
Browse files Browse the repository at this point in the history
  • Loading branch information
kennethkalmer committed Nov 8, 2009
1 parent 62ef2ce commit fca8dfa
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/ruote-kit/helpers/engine_helpers.rb
Expand Up @@ -6,8 +6,8 @@ def engine
RuoteKit.engine
end

def catchall
RuoteKit.configuration.catchall_participant
def store_participant
RuoteKit.engine.plist.lookup('.*')
end

end
Expand Down
9 changes: 9 additions & 0 deletions lib/ruote-kit/resources/workitems.rb
@@ -1,3 +1,12 @@
class RuoteKit::Application

get "/workitems" do
@workitems = store_participant.all

respond_to do |format|
format.html { haml :workitems }
format.json { json( :workitems, @workitems.map { |wi| wi.to_json } ) }
end
end

end
4 changes: 4 additions & 0 deletions lib/ruote-kit/views/workitems.html.haml
@@ -0,0 +1,4 @@
%h1 Workitems

- if @workitems.empty?
%h2 No workitems are currently available
5 changes: 1 addition & 4 deletions spec/resources/workitems_spec.rb
Expand Up @@ -3,13 +3,10 @@
describe "GET /workitems" do
describe "without any workitems" do
it "should report no workitems (HTML)" do
pending
get "/workitems"

last_response.should be_ok
last_response.should match(/No workitems are available/)

assigns[:workitems].should be_empty
last_response.should match(/No workitems are currently available/)
end

it "should report no workitems (JSON)"
Expand Down

0 comments on commit fca8dfa

Please sign in to comment.