diff --git a/Rakefile b/Rakefile index 20ab79f630e..bc0ec2a73b9 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 227d9521ea9..1f534db25ee 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 892195e80e0..e71e75a3e07 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 @@ 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 @@ 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