Skip to content

Commit

Permalink
Implement given step for the next recipe details scenario.
Browse files Browse the repository at this point in the history
  • Loading branch information
eee-c committed Mar 31, 2009
1 parent 8043cca commit b168fbc
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions features/step_definitions/recipe_details.rb
Expand Up @@ -35,6 +35,23 @@
:content_type => 'application/json'
end

Given /^a recipe for Crockpot Lentil Andouille Soup$/ do
@date = Date.new(2009, 3, 24)
@title = "Crockpot Lentil Andouille Soup"
@permalink = @date.to_s + "-" + @title.downcase.gsub(/\W/, '-')

recipe = {
:title => @title,
:date => @date,
:inactive_time => 300,
:prep_time => 15
}

RestClient.put "#{@@db}/#{@permalink}",
recipe.to_json,
:content_type => 'application/json'
end

When /^I view the recipe$/ do
visit("/recipes/#{@permalink}")
end
Expand All @@ -46,3 +63,7 @@
gsub(/\)/, "\\)")
response.should contain(Regexp.new(matcher))
end

Then /^I should see 15 minutes of prep time$/ do
pending
end

0 comments on commit b168fbc

Please sign in to comment.