Skip to content

Commit

Permalink
Fixing story for namespaced user & session models
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip (flip) Kromer committed Sep 4, 2008
1 parent 2dc76e7 commit b23f6ef
Showing 1 changed file with 6 additions and 6 deletions.
Expand Up @@ -4,7 +4,7 @@
steps_for(:ra_navigation) do
#
# GET
# Go to a given page.
# Go to a given page.
When "$actor goes to $path" do |actor, path|
case path
when 'the home page' then get '/'
Expand All @@ -18,15 +18,15 @@
# Since I'm not smrt enough to do it right, explicitly specify singular resources
When %r{$actor creates an? $resource with $attributes} do |actor, resource, attributes|
attributes = attributes.to_hash_from_story
if resource =~ /singular (\w+)/
if resource =~ %r{singular ([\w/]+)}
resource = $1.downcase.singularize
post "/#{resource}", attributes
else
else
post "/#{resource.downcase.pluralize}", { resource.downcase.singularize => attributes }
end
end

# PUT
# PUT
When %r{$actor asks to update '$resource' with $attributes} do |_, resource, attributes|
attributes = attributes.to_hash_from_story
put "#{resource}", attributes
Expand All @@ -38,8 +38,8 @@
post "/#{resource.downcase.pluralize}", { :_method => :delete }
dump_response
end


# Redirect --
# Rather than coding in get/get_via_redirect's and past/p_v_r's,
# let's just demand that in the story itself.
Expand Down

0 comments on commit b23f6ef

Please sign in to comment.