Added cleanup of searchindex in test file.
This commit is contained in:
parent
6004e48cbd
commit
2e2aa91375
5 changed files with 28 additions and 0 deletions
|
@ -155,6 +155,10 @@ class Observer::Ticket::Article::CommunicateEmail::BackgroundJob
|
||||||
updated_by_id: 1,
|
updated_by_id: 1,
|
||||||
created_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
|
end
|
||||||
|
|
||||||
raise message
|
raise message
|
||||||
|
|
|
@ -34,6 +34,12 @@ class FormControllerTest < ActionDispatch::IntegrationTest
|
||||||
Rake::Task['searchindex:rebuild'].execute
|
Rake::Task['searchindex:rebuild'].execute
|
||||||
end
|
end
|
||||||
|
|
||||||
|
teardown do
|
||||||
|
if ENV['ES_URL'].present?
|
||||||
|
Rake::Task['searchindex:drop'].execute
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
test '01 - get config call' do
|
test '01 - get config call' do
|
||||||
post '/api/v1/form_config', {}.to_json, @headers
|
post '/api/v1/form_config', {}.to_json, @headers
|
||||||
assert_response(401)
|
assert_response(401)
|
||||||
|
|
|
@ -179,6 +179,12 @@ class SearchControllerTest < ActionDispatch::IntegrationTest
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
teardown do
|
||||||
|
if ENV['ES_URL'].present?
|
||||||
|
Rake::Task['searchindex:drop'].execute
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
test 'settings index with nobody' do
|
test 'settings index with nobody' do
|
||||||
params = {
|
params = {
|
||||||
query: 'test 1234',
|
query: 'test 1234',
|
||||||
|
|
|
@ -100,6 +100,12 @@ class ElasticsearchTest < ActiveSupport::TestCase
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
teardown do
|
||||||
|
if ENV['ES_URL'].present?
|
||||||
|
Rake::Task['searchindex:drop'].execute
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# check search attributes
|
# check search attributes
|
||||||
test 'a - objects' do
|
test 'a - objects' do
|
||||||
|
|
||||||
|
|
|
@ -250,6 +250,12 @@ class ReportTest < ActiveSupport::TestCase
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
teardown do
|
||||||
|
if ENV['ES_URL'].present?
|
||||||
|
Rake::Task['searchindex:drop'].execute
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
test 'compare' do
|
test 'compare' do
|
||||||
|
|
||||||
# first solution
|
# first solution
|
||||||
|
|
Loading…
Reference in a new issue