Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Given step for the "Main site categories" scenario
  • Loading branch information
eee-c committed Apr 3, 2009
1 parent bb5f193 commit 6e50b8b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
4 changes: 2 additions & 2 deletions features/recipe_details.feature
Expand Up @@ -28,6 +28,6 @@ Feature: Recipe Details
Scenario: Main site categories

Given a recipe for Mango and Tomato Salad
And site-wide categories of Italian, Asian, Latin, Breakfast, Chicken, Fish, Meat, Salad, and Vegetarian
When I view the recipe
Then the Salad and Vegetarian categories should be active
Then I should see the site-wide categories of Italian, Asian, Latin, Breakfast, Chicken, Fish, Meat, Salad, and Vegetarian
And the Salad and Vegetarian categories should be active
24 changes: 24 additions & 0 deletions features/step_definitions/recipe_details.rb
Expand Up @@ -94,6 +94,22 @@
:content_type => 'application/json'
end

Given /^a recipe for Mango and Tomato Salad$/ do
@date = Date.new(2009, 4, 2)
@title = "Mango and Tomato Salad"
@permalink = @date.to_s + "-" + @title.downcase.gsub(/\W/, '-')

recipe = {
:title => @title,
:date => @date,
:tag_names => [ "vegetarian", "salad" ]
}

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

When /^I view the recipe$/ do
visit("/recipes/#{@permalink}")
end
Expand Down Expand Up @@ -122,3 +138,11 @@
response.should contain(tool.sub(/an? /, ''))
end
end

Then /^I should see the site\-wide categories of (.+)$/ do |category_list|
pending
end

Then /^the Salad and Vegetarian categories should be active$/ do
pending
end

0 comments on commit 6e50b8b

Please sign in to comment.