Skip to content

Commit 4b7c26e

Browse files
committed
[RAILS] Fixed the incorrect unit test for the Article model
1 parent 8744f0e commit 4b7c26e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

elasticsearch-rails/lib/rails/templates/03-expert.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ class Article < ActiveRecord::Base
154154
end
155155
CODE
156156

157+
gsub_file "#{Rails::VERSION::STRING > '4' ? 'test/models' : 'test/unit' }/article_test.rb", %r{assert_equal 'foo', definition\[:query\]\[:multi_match\]\[:query\]}, "assert_equal 'foo', definition.to_hash[:query][:bool][:should][0][:multi_match][:query]"
158+
157159
# copy_file File.expand_path('../searchable.rb', __FILE__), 'app/models/concerns/searchable.rb'
158160
get 'https://raw.github.com/elasticsearch/elasticsearch-rails/templates/elasticsearch-rails/lib/rails/templates/searchable.rb',
159161
'app/models/concerns/searchable.rb'
@@ -170,7 +172,7 @@ class Article < ActiveRecord::Base
170172
CODE
171173
end
172174

173-
git add: "app/models/"
175+
git add: "app/models/ test/models"
174176
git commit: "-m 'Refactored the Elasticsearch integration into a concern\n\nSee:\n\n* http://37signals.com/svn/posts/3372-put-chubby-models-on-a-diet-with-concerns\n* http://joshsymonds.com/blog/2012/10/25/rails-concerns-v-searchable-with-elasticsearch/'"
175177

176178
# ----- Add Sidekiq indexer -----------------------------------------------------------------------

0 commit comments

Comments
 (0)