Skip to content

Commit

Permalink
add cucumber task to test index rebuilds
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsdeleo committed Dec 22, 2009
1 parent 97b352c commit bfe18ea
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
4 changes: 4 additions & 0 deletions Rakefile
Expand Up @@ -323,6 +323,10 @@ namespace :features do
Cucumber::Rake::Task.new(:show) do |t|
t.profile = "api_search_show"
end
desc "Run cucumber tests for searching via the REST API"
Cucumber::Rake::Task.new(:reindex) do |t|
t.profile = "api_search_reindex"
end
end
end

Expand Down
1 change: 1 addition & 0 deletions cucumber.yml
Expand Up @@ -27,6 +27,7 @@ api_data_item: --tags @api_data_item --format pretty -r features/steps -r featur
api_search: --tags @api_search --format pretty -r features/steps -r features/support features
api_search_list: --tags @api_search_list --format pretty -r features/steps -r features/support features
api_search_show: --tags @api_search_show --format pretty -r features/steps -r features/support features
api_search_reindex: --tags @api_search_reindex --format pretty -r features/steps -r features/support features
client: --tags @client --format pretty -r features/steps -r features/support features
client_roles: --tags client_roles --format pretty -r features/steps -r features/support features
client_cookbook_sync: --tags @client-cookbook-sync --format pretty -r features/steps -r features/support features
Expand Down
17 changes: 11 additions & 6 deletions features/steps/request_steps.rb
@@ -1,3 +1,10 @@
Given /^I dump the contents of the search index$/ do
rest.get_rest("/search/").each do |index_name, index_url|
puts "INDEX NAME: `#{index_name}'"
pp rest.get_rest(index_url.sub("http://127.0.0.1:4000", ''))
end
end

When /^I '([^']*)' (?:to )?the path '([^']*)'$/ do |http_method, request_uri|
begin
self.response = rest.send("#{http_method}_rest".downcase.to_sym, request_uri)
Expand All @@ -8,10 +15,6 @@
end
end

When /^I '([^']*)' to the path '(.+)'$/ do |http_method, request_uri|
When "I '#{http_method}' the path '#{request_uri}'"
end

When /^I '(.+)' the path '(.+)' using a wrong private key$/ do |http_method, request_uri|
key = OpenSSL::PKey::RSA.generate(2048)
File.open(File.join(tmpdir, 'false_key.pem'), "w") { |f| f.print key }
Expand Down Expand Up @@ -58,8 +61,10 @@
end
end



#When /^I dump the contents of the search index$/ do
# Given "I dump the contents of the search index"
#end
#

# When /^I '(.+)' the path '(.+)'$/ do |http_method, request_uri|
# begin
Expand Down

0 comments on commit bfe18ea

Please sign in to comment.