Skip to content

Commit

Permalink
Some cucumber work to get previously completed features marked as done.
Browse files Browse the repository at this point in the history
  • Loading branch information
eee-c committed Aug 22, 2009
1 parent 3703ac1 commit a2b4717
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
8 changes: 7 additions & 1 deletion features/step_definitions/recipe_details.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@
:title => title,
:date => date,
:summary => "#{title} summary",
:instructions => "#{title} instructions"
:instructions => "#{title} instructions",
:type => "Recipe"
}

RestClient.put "#{@@db}/#{@recipe_permalink}",
Expand All @@ -154,6 +155,11 @@
visit("/recipes/#{@permalink}")
end

When /^I view the "([^\"]*)" recipe$/ do |title|
visit("/recipes/#{@recipe_permalink}")
end


Then /^I should see an ingredient of "(.+)"$/ do |ingredient|
matcher = ingredient.
gsub(/\s+/, "\\s+").
Expand Down
5 changes: 5 additions & 0 deletions features/step_definitions/recipe_search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@
end

When /^I search for "(.*)"$/ do |keyword|
@keyword = keyword
@query = "/recipes/search?q=#{keyword}"
visit(@query)
end
Expand Down Expand Up @@ -325,3 +326,7 @@
Then /^I should see an empty query string$/ do
response.should have_selector("input[@name=q][@value='']")
end

Then /^I should see the search field for refining my search$/ do
response.should have_selector("input[@name=q][@value='#{@keyword}']")
end

0 comments on commit a2b4717

Please sign in to comment.