Added cleanup of searchindex in test file.

This commit is contained in:
Martin Edenhofer 2017-07-25 16:00:43 +02:00
parent 6004e48cbd
commit 2e2aa91375
5 changed files with 28 additions and 0 deletions

View file

@ -155,6 +155,10 @@ class Observer::Ticket::Article::CommunicateEmail::BackgroundJob
updated_by_id: 1,
created_by_id: 1,
)
ticket = Ticket.find(local_record.ticket_id)
ticket.state = Ticket::State.find_by(default_follow_up: true)
ticket.save!
end
raise message

View file

@ -34,6 +34,12 @@ class FormControllerTest < ActionDispatch::IntegrationTest
Rake::Task['searchindex:rebuild'].execute
end
teardown do
if ENV['ES_URL'].present?
Rake::Task['searchindex:drop'].execute
end
end
test '01 - get config call' do
post '/api/v1/form_config', {}.to_json, @headers
assert_response(401)

View file

@ -179,6 +179,12 @@ class SearchControllerTest < ActionDispatch::IntegrationTest
end
end
teardown do
if ENV['ES_URL'].present?
Rake::Task['searchindex:drop'].execute
end
end
test 'settings index with nobody' do
params = {
query: 'test 1234',

View file

@ -100,6 +100,12 @@ class ElasticsearchTest < ActiveSupport::TestCase
)
end
teardown do
if ENV['ES_URL'].present?
Rake::Task['searchindex:drop'].execute
end
end
# check search attributes
test 'a - objects' do

View file

@ -250,6 +250,12 @@ class ReportTest < ActiveSupport::TestCase
end
teardown do
if ENV['ES_URL'].present?
Rake::Task['searchindex:drop'].execute
end
end
test 'compare' do
# first solution