Commit ae788bac8696b4af02713de5790155241cdd9df1
1 parent
4a36ce9e
Exists in
master
and in
29 other branches
Fixing solr steps folder name
Showing
2 changed files
with
18 additions
and
18 deletions
Show diff stats
... | ... | @@ -0,0 +1,18 @@ |
1 | +Given /^the search index is empty$/ do | |
2 | + ActsAsSolr::Post.execute(Solr::Request::Delete.new(:query => '*:*')) | |
3 | +end | |
4 | + | |
5 | +# This could be merged with "the following categories" | |
6 | +Given /^the following categories as facets$/ do |table| | |
7 | + ids = [] | |
8 | + table.hashes.each do |item| | |
9 | + cat = Category.find_by_name(item[:name]) | |
10 | + if cat.nil? | |
11 | + cat = Category.create!(:environment_id => Environment.default.id, :name => item[:name]) | |
12 | + end | |
13 | + ids << cat.id | |
14 | + end | |
15 | + env = Environment.default | |
16 | + env.top_level_category_as_facet_ids = ids | |
17 | + env.save! | |
18 | +end | ... | ... |
plugins/solr/features/steps/solr_steps.rb
... | ... | @@ -1,18 +0,0 @@ |
1 | -Given /^the search index is empty$/ do | |
2 | - ActsAsSolr::Post.execute(Solr::Request::Delete.new(:query => '*:*')) | |
3 | -end | |
4 | - | |
5 | -# This could be merged with "the following categories" | |
6 | -Given /^the following categories as facets$/ do |table| | |
7 | - ids = [] | |
8 | - table.hashes.each do |item| | |
9 | - cat = Category.find_by_name(item[:name]) | |
10 | - if cat.nil? | |
11 | - cat = Category.create!(:environment_id => Environment.default.id, :name => item[:name]) | |
12 | - end | |
13 | - ids << cat.id | |
14 | - end | |
15 | - env = Environment.default | |
16 | - env.top_level_category_as_facet_ids = ids | |
17 | - env.save! | |
18 | -end |