Skip to content

Commit

Permalink
Use the right permalink when verifying search results
Browse files Browse the repository at this point in the history
  • Loading branch information
eee-c committed Apr 18, 2009
1 parent 27f0872 commit 0b7ad24
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion features/step_definitions/recipe_search.rb
Expand Up @@ -55,6 +55,21 @@
:content_type => 'application/json'
end

Given /^a "(.+)" recipe with instructions "(.+)"$/ do |title, instructions|
date = Date.new(2009, 4, 16)
permalink = "id-#{title.gsub(/\W/, '-')}"

recipe = {
:title => title,
:date => date,
:instructions => instructions
}

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

Given /^a (\d+) second wait to allow the search index to be updated$/ do |seconds|
sleep seconds.to_i
end
Expand All @@ -65,7 +80,7 @@

Then /^I should see the "(.+)" recipe in the search results$/ do |title|
response.should have_selector("a",
:href => "/recipes/id-#{title}",
:href => "/recipes/id-#{title.gsub(/\W/, '-')}",
:content => title)
end

Expand Down

0 comments on commit 0b7ad24

Please sign in to comment.