Commit 123b7823c63cb36acade6bc3e59a33f043b1615e

Authored by Macartur Sousa
1 parent aa3eed72
Exists in elasticsearch_api

Fixed model tests

Signed-off-by: Macartur Sousa <macartur.sc@gmail.com>
plugins/elasticsearch/test/test_helper.rb
... ... @@ -26,4 +26,8 @@ class ElasticsearchTestHelper &lt; ActionController::TestCase
26 26 @environment.enable_plugin(ElasticsearchPlugin)
27 27 end
28 28  
  29 + def indexed_models
  30 + []
  31 + end
  32 +
29 33 end
... ...
plugins/elasticsearch/test/unit/elasticsearch_test.rb
1 1 require "#{File.dirname(__FILE__)}/../test_helper"
2 2  
3   -class ElasticsearchTest < ActiveSupport::TestCase
4   - def setup
5   - @environment = Environment.default
6   - @environment.enable_plugin(ElasticsearchPlugin)
7   - @profile = create_user('testing').person
8   - end
9   -
  3 +class ElasticsearchTest < ElasticsearchTestHelper
10 4  
11 5 should 'be return yellow for health status' do
12 6 cluster = Elasticsearch::Model.client.cluster
... ...
plugins/elasticsearch/test/unit/models/community_test.rb
1 1 require "#{File.dirname(__FILE__)}/../../test_helper"
2 2  
3   -class CommunityTest < ActiveSupport::TestCase
  3 +class CommunityTest < ElasticsearchTestHelper
  4 +
  5 + def indexed_models
  6 + [Community, Person]
  7 + end
  8 +
4 9 def setup
5   - @environment = Environment.default
6   - @environment.enable_plugin(ElasticsearchPlugin)
7 10 @profile = create_user('testing').person
  11 + super
8 12 end
9 13  
10 14 should 'index custom fields for Event model' do
... ...
plugins/elasticsearch/test/unit/models/event_test.rb
1 1 require "#{File.dirname(__FILE__)}/../../test_helper"
2 2  
3   -class EventTest < ActiveSupport::TestCase
  3 +class EventTest < ElasticsearchTestHelper
  4 +
  5 + def indexed_models
  6 + [Event]
  7 + end
  8 +
4 9 def setup
5   - @environment = Environment.default
6   - @environment.enable_plugin(ElasticsearchPlugin)
7 10 @profile = create_user('testing').person
  11 + super
8 12 end
9 13  
10 14 should 'index custom fields for Event model' do
... ...
plugins/elasticsearch/test/unit/models/person_test.rb
1 1 require "#{File.dirname(__FILE__)}/../../test_helper"
2 2  
3   -class PersonTest < ActiveSupport::TestCase
  3 +class PersonTest < ElasticsearchTestHelper
  4 +
  5 + def indexed_models
  6 + [Event]
  7 + end
  8 +
4 9 def setup
5   - @environment = Environment.default
6   - @environment.enable_plugin(ElasticsearchPlugin)
7 10 @profile = create_user('testing').person
  11 + super
8 12 end
9 13  
10 14 should 'index custom fields for Event model' do
... ...