Applied rubocop suggestions.
This commit is contained in:
parent
e7fe3f827f
commit
2b6b268eb9
27 changed files with 27 additions and 27 deletions
|
@ -3,7 +3,7 @@
|
||||||
require 'browser_test_helper'
|
require 'browser_test_helper'
|
||||||
|
|
||||||
class IntegrationCtiTest < TestCase
|
class IntegrationCtiTest < TestCase
|
||||||
setup do
|
before do
|
||||||
if !ENV['CTI_TOKEN']
|
if !ENV['CTI_TOKEN']
|
||||||
raise "ERROR: Need CTI_TOKEN - hint CTI_TOKEN='some_token'"
|
raise "ERROR: Need CTI_TOKEN - hint CTI_TOKEN='some_token'"
|
||||||
end
|
end
|
||||||
|
|
|
@ -24,7 +24,7 @@ class TestCase < ActiveSupport::TestCase
|
||||||
|
|
||||||
DEBUG = true
|
DEBUG = true
|
||||||
|
|
||||||
setup do
|
before do
|
||||||
# print current test case to STDOUT
|
# print current test case to STDOUT
|
||||||
# for status reasoning and debugging purposes
|
# for status reasoning and debugging purposes
|
||||||
source_location = self.class.instance_method(method_name).source_location
|
source_location = self.class.instance_method(method_name).source_location
|
||||||
|
|
|
@ -5,7 +5,7 @@ require 'test_helper'
|
||||||
class ElasticsearchActiveTest < ActiveSupport::TestCase
|
class ElasticsearchActiveTest < ActiveSupport::TestCase
|
||||||
include SearchindexHelper
|
include SearchindexHelper
|
||||||
|
|
||||||
setup do
|
before do
|
||||||
|
|
||||||
configure_elasticsearch(required: true)
|
configure_elasticsearch(required: true)
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ require 'test_helper'
|
||||||
class ElasticsearchTest < ActiveSupport::TestCase
|
class ElasticsearchTest < ActiveSupport::TestCase
|
||||||
include SearchindexHelper
|
include SearchindexHelper
|
||||||
|
|
||||||
setup do
|
before do
|
||||||
|
|
||||||
configure_elasticsearch(required: true)
|
configure_elasticsearch(required: true)
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ require 'test_helper'
|
||||||
require 'net/imap'
|
require 'net/imap'
|
||||||
|
|
||||||
class EmailKeepOnServerTest < ActiveSupport::TestCase
|
class EmailKeepOnServerTest < ActiveSupport::TestCase
|
||||||
setup do
|
before do
|
||||||
|
|
||||||
if ENV['KEEP_ON_MAIL_SERVER'].blank?
|
if ENV['KEEP_ON_MAIL_SERVER'].blank?
|
||||||
raise "Need KEEP_ON_MAIL_SERVER as ENV variable like export KEEP_ON_MAIL_SERVER='mx.example.com'"
|
raise "Need KEEP_ON_MAIL_SERVER as ENV variable like export KEEP_ON_MAIL_SERVER='mx.example.com'"
|
||||||
|
|
|
@ -5,7 +5,7 @@ require 'net/imap'
|
||||||
|
|
||||||
class EmailPostmasterToSender < ActiveSupport::TestCase
|
class EmailPostmasterToSender < ActiveSupport::TestCase
|
||||||
|
|
||||||
setup do
|
before do
|
||||||
Setting.set('postmaster_max_size', 0.1)
|
Setting.set('postmaster_max_size', 0.1)
|
||||||
|
|
||||||
@test_id = rand(999_999_999)
|
@test_id = rand(999_999_999)
|
||||||
|
|
|
@ -5,7 +5,7 @@ require 'webmock/minitest'
|
||||||
|
|
||||||
class GeoLocationTest < ActiveSupport::TestCase
|
class GeoLocationTest < ActiveSupport::TestCase
|
||||||
|
|
||||||
setup do
|
before do
|
||||||
@mock = true
|
@mock = true
|
||||||
#WebMock.allow_net_connect!
|
#WebMock.allow_net_connect!
|
||||||
end
|
end
|
||||||
|
|
|
@ -5,7 +5,7 @@ require 'integration_test_helper'
|
||||||
class ReportTest < ActiveSupport::TestCase
|
class ReportTest < ActiveSupport::TestCase
|
||||||
include SearchindexHelper
|
include SearchindexHelper
|
||||||
|
|
||||||
setup do
|
before do
|
||||||
|
|
||||||
# create attribute
|
# create attribute
|
||||||
ObjectManager::Attribute.add(
|
ObjectManager::Attribute.add(
|
||||||
|
|
|
@ -6,7 +6,7 @@ class UserAgentTest < ActiveSupport::TestCase
|
||||||
host = 'https://web-test.dc.zammad.com'
|
host = 'https://web-test.dc.zammad.com'
|
||||||
#host = 'http://127.0.0.1:3003'
|
#host = 'http://127.0.0.1:3003'
|
||||||
|
|
||||||
setup do
|
before do
|
||||||
if ENV['ZAMMAD_PROXY_TEST'] == 'true'
|
if ENV['ZAMMAD_PROXY_TEST'] == 'true'
|
||||||
Setting.set('proxy', ENV['ZAMMAD_PROXY'])
|
Setting.set('proxy', ENV['ZAMMAD_PROXY'])
|
||||||
Setting.set('proxy_username', ENV['ZAMMAD_PROXY_USERNAME'])
|
Setting.set('proxy_username', ENV['ZAMMAD_PROXY_USERNAME'])
|
||||||
|
|
|
@ -25,7 +25,7 @@ class ActiveSupport::TestCase
|
||||||
# set system mode to done / to activate
|
# set system mode to done / to activate
|
||||||
Setting.set('system_init_done', true)
|
Setting.set('system_init_done', true)
|
||||||
|
|
||||||
setup do
|
before do
|
||||||
|
|
||||||
# clear cache
|
# clear cache
|
||||||
Cache.clear
|
Cache.clear
|
||||||
|
|
|
@ -22,7 +22,7 @@ class ActiveSupport::TestCase
|
||||||
# set system mode to done / to activate
|
# set system mode to done / to activate
|
||||||
Setting.set('system_init_done', true)
|
Setting.set('system_init_done', true)
|
||||||
|
|
||||||
setup do
|
before do
|
||||||
|
|
||||||
# exit all threads
|
# exit all threads
|
||||||
Thread.list.each do |thread|
|
Thread.list.each do |thread|
|
||||||
|
|
|
@ -4,7 +4,7 @@ require 'test_helper'
|
||||||
|
|
||||||
class ActivityStreamTest < ActiveSupport::TestCase
|
class ActivityStreamTest < ActiveSupport::TestCase
|
||||||
|
|
||||||
setup do
|
before do
|
||||||
roles = Role.where(name: %w[Admin Agent])
|
roles = Role.where(name: %w[Admin Agent])
|
||||||
groups = Group.where(name: 'Users')
|
groups = Group.where(name: 'Users')
|
||||||
@admin_user = User.create_or_update(
|
@admin_user = User.create_or_update(
|
||||||
|
|
|
@ -4,7 +4,7 @@ require 'test_helper'
|
||||||
|
|
||||||
class ChatTest < ActiveSupport::TestCase
|
class ChatTest < ActiveSupport::TestCase
|
||||||
|
|
||||||
setup do
|
before do
|
||||||
groups = Group.all
|
groups = Group.all
|
||||||
roles = Role.where(name: %w[Agent])
|
roles = Role.where(name: %w[Agent])
|
||||||
@agent1 = User.create!(
|
@agent1 = User.create!(
|
||||||
|
|
|
@ -4,7 +4,7 @@ require 'test_helper'
|
||||||
|
|
||||||
class EmailProcessSenderIsSystemAddressOrAgent < ActiveSupport::TestCase
|
class EmailProcessSenderIsSystemAddressOrAgent < ActiveSupport::TestCase
|
||||||
|
|
||||||
setup do
|
before do
|
||||||
EmailAddress.create_or_update(
|
EmailAddress.create_or_update(
|
||||||
channel_id: 1,
|
channel_id: 1,
|
||||||
realname: 'My System',
|
realname: 'My System',
|
||||||
|
|
|
@ -9,7 +9,7 @@ class IntegrationIcingaTest < ActiveSupport::TestCase
|
||||||
# http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/monitoring-basics#host-states
|
# http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/monitoring-basics#host-states
|
||||||
# http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/monitoring-basics#service-states
|
# http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/monitoring-basics#service-states
|
||||||
|
|
||||||
setup do
|
before do
|
||||||
Setting.set('icinga_integration', true)
|
Setting.set('icinga_integration', true)
|
||||||
Setting.set('icinga_sender', 'icinga2@monitoring.example.com')
|
Setting.set('icinga_sender', 'icinga2@monitoring.example.com')
|
||||||
end
|
end
|
||||||
|
|
|
@ -7,7 +7,7 @@ class IntegrationMonitTest < ActiveSupport::TestCase
|
||||||
# according
|
# according
|
||||||
# https://mmonit.com/monit/documentation/#ALERT-MESSAGES
|
# https://mmonit.com/monit/documentation/#ALERT-MESSAGES
|
||||||
|
|
||||||
setup do
|
before do
|
||||||
Setting.set('monit_integration', true)
|
Setting.set('monit_integration', true)
|
||||||
Setting.set('monit_sender', 'monit@monitoring.example.com')
|
Setting.set('monit_sender', 'monit@monitoring.example.com')
|
||||||
end
|
end
|
||||||
|
|
|
@ -7,7 +7,7 @@ class IntegrationNagiosTest < ActiveSupport::TestCase
|
||||||
# according
|
# according
|
||||||
# https://github.com/NagiosEnterprises/nagioscore/blob/754218e67653929a58938b99ef6b6039b6474fe4/sample-config/template-object/commands.cfg.in#L35
|
# https://github.com/NagiosEnterprises/nagioscore/blob/754218e67653929a58938b99ef6b6039b6474fe4/sample-config/template-object/commands.cfg.in#L35
|
||||||
|
|
||||||
setup do
|
before do
|
||||||
Setting.set('nagios_integration', true)
|
Setting.set('nagios_integration', true)
|
||||||
Setting.set('nagios_sender', 'nagios2@monitoring.example.com')
|
Setting.set('nagios_sender', 'nagios2@monitoring.example.com')
|
||||||
end
|
end
|
||||||
|
|
|
@ -4,7 +4,7 @@ require 'test_helper'
|
||||||
|
|
||||||
class OnlineNotificationTest < ActiveSupport::TestCase
|
class OnlineNotificationTest < ActiveSupport::TestCase
|
||||||
|
|
||||||
setup do
|
before do
|
||||||
role = Role.lookup(name: 'Agent')
|
role = Role.lookup(name: 'Agent')
|
||||||
@group = Group.create_or_update(
|
@group = Group.create_or_update(
|
||||||
name: 'OnlineNotificationTest',
|
name: 'OnlineNotificationTest',
|
||||||
|
|
|
@ -4,7 +4,7 @@ require 'test_helper'
|
||||||
|
|
||||||
class TicketLastOwnerUpdateTest < ActiveSupport::TestCase
|
class TicketLastOwnerUpdateTest < ActiveSupport::TestCase
|
||||||
|
|
||||||
setup do
|
before do
|
||||||
Group.create_or_update(
|
Group.create_or_update(
|
||||||
name: 'LastOwnerUpdate',
|
name: 'LastOwnerUpdate',
|
||||||
email_address: EmailAddress.first,
|
email_address: EmailAddress.first,
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
|
|
||||||
class TicketNotificationTest < ActiveSupport::TestCase
|
class TicketNotificationTest < ActiveSupport::TestCase
|
||||||
setup do
|
before do
|
||||||
Setting.set('timezone_default', 'Europe/Berlin')
|
Setting.set('timezone_default', 'Europe/Berlin')
|
||||||
Trigger.create_or_update(
|
Trigger.create_or_update(
|
||||||
name: 'auto reply - new ticket',
|
name: 'auto reply - new ticket',
|
||||||
|
|
|
@ -4,7 +4,7 @@ require 'test_helper'
|
||||||
|
|
||||||
class TicketOverviewOutOfOfficeTest < ActiveSupport::TestCase
|
class TicketOverviewOutOfOfficeTest < ActiveSupport::TestCase
|
||||||
|
|
||||||
setup do
|
before do
|
||||||
group = Group.create_or_update(
|
group = Group.create_or_update(
|
||||||
name: 'OverviewReplacementTest',
|
name: 'OverviewReplacementTest',
|
||||||
updated_at: '2015-02-05 16:37:00',
|
updated_at: '2015-02-05 16:37:00',
|
||||||
|
|
|
@ -4,7 +4,7 @@ require 'test_helper'
|
||||||
|
|
||||||
class TicketOverviewTest < ActiveSupport::TestCase
|
class TicketOverviewTest < ActiveSupport::TestCase
|
||||||
|
|
||||||
setup do
|
before do
|
||||||
group = Group.create_or_update(
|
group = Group.create_or_update(
|
||||||
name: 'OverviewTest',
|
name: 'OverviewTest',
|
||||||
updated_at: '2015-02-05 16:37:00',
|
updated_at: '2015-02-05 16:37:00',
|
||||||
|
|
|
@ -4,7 +4,7 @@ require 'test_helper'
|
||||||
|
|
||||||
class TicketSelectorTest < ActiveSupport::TestCase
|
class TicketSelectorTest < ActiveSupport::TestCase
|
||||||
|
|
||||||
setup do
|
before do
|
||||||
@group = Group.create_or_update(
|
@group = Group.create_or_update(
|
||||||
name: 'SelectorTest',
|
name: 'SelectorTest',
|
||||||
updated_at: '2015-02-05 16:37:00',
|
updated_at: '2015-02-05 16:37:00',
|
||||||
|
|
|
@ -4,7 +4,7 @@ require 'test_helper'
|
||||||
|
|
||||||
class TicketTest < ActiveSupport::TestCase
|
class TicketTest < ActiveSupport::TestCase
|
||||||
|
|
||||||
setup do
|
before do
|
||||||
Ticket.destroy_all
|
Ticket.destroy_all
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ require 'test_helper'
|
||||||
|
|
||||||
class TicketTriggerExtendedTest < ActiveSupport::TestCase
|
class TicketTriggerExtendedTest < ActiveSupport::TestCase
|
||||||
|
|
||||||
setup do
|
before do
|
||||||
Setting.set('ticket_trigger_recursive', true)
|
Setting.set('ticket_trigger_recursive', true)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ require 'test_helper'
|
||||||
|
|
||||||
class TicketTriggerRecursiveDisabledTest < ActiveSupport::TestCase
|
class TicketTriggerRecursiveDisabledTest < ActiveSupport::TestCase
|
||||||
|
|
||||||
setup do
|
before do
|
||||||
Setting.set('ticket_trigger_recursive', false)
|
Setting.set('ticket_trigger_recursive', false)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ require 'test_helper'
|
||||||
|
|
||||||
class TicketTriggerTest < ActiveSupport::TestCase
|
class TicketTriggerTest < ActiveSupport::TestCase
|
||||||
|
|
||||||
setup do
|
before do
|
||||||
Setting.set('ticket_trigger_recursive', true)
|
Setting.set('ticket_trigger_recursive', true)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue