summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan DeLeo <danielsdeleo@mac.com>2009-12-21 19:40:52 -0700
committerDan DeLeo <danielsdeleo@mac.com>2009-12-21 20:59:55 -0700
commitbfe18eaf55358af4c81ead2453a3ea3754659feb (patch)
tree1f126a84ecf61d0b63cddf13d91f206de927b1a0
parent97b352c9e588e6949072e4dcdee4ef26c33d8cea (diff)
downloadchef-bfe18eaf55358af4c81ead2453a3ea3754659feb.tar.gz
add cucumber task to test index rebuilds
-rw-r--r--Rakefile4
-rw-r--r--cucumber.yml1
-rw-r--r--features/steps/request_steps.rb17
3 files changed, 16 insertions, 6 deletions
diff --git a/Rakefile b/Rakefile
index 20ab79f630..bc0ec2a73b 100644
--- a/Rakefile
+++ b/Rakefile
@@ -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
diff --git a/cucumber.yml b/cucumber.yml
index 227d9521ea..1f534db25e 100644
--- a/cucumber.yml
+++ b/cucumber.yml
@@ -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
diff --git a/features/steps/request_steps.rb b/features/steps/request_steps.rb
index 892195e80e..e71e75a3e0 100644
--- a/features/steps/request_steps.rb
+++ b/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)
@@ -8,10 +15,6 @@ When /^I '([^']*)' (?:to )?the path '([^']*)'$/ do |http_method, request_uri|
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 }
@@ -58,8 +61,10 @@ When /^I authenticate as '(.+)'$/ do |reg|
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