Applied rubocop Style/EmptyLines.
This commit is contained in:
parent
bd1db72b9b
commit
e474ac197a
53 changed files with 0 additions and 127 deletions
|
@ -139,7 +139,6 @@ class IcalTicketsController < ApplicationController
|
|||
events_data
|
||||
end
|
||||
|
||||
|
||||
def escalation_events_data_get
|
||||
|
||||
condition = [
|
||||
|
|
|
@ -5,7 +5,6 @@ class ImportOtrsController < ApplicationController
|
|||
def url_check
|
||||
return if setup_done_response
|
||||
|
||||
|
||||
# validate
|
||||
if !params[:url] ||params[:url] !~ /^(http|https):\/\/.+?$/
|
||||
render json: {
|
||||
|
@ -63,7 +62,6 @@ class ImportOtrsController < ApplicationController
|
|||
end
|
||||
}
|
||||
|
||||
|
||||
# return result
|
||||
render json: {
|
||||
result: 'invalid',
|
||||
|
|
|
@ -53,7 +53,6 @@ class LongPollingController < ApplicationController
|
|||
Sessions.send( client_id, { event: 'spool:sent', data: { timestamp: Time.now.utc.to_i } } )
|
||||
end
|
||||
|
||||
|
||||
# receive message
|
||||
if params['data']['action'] == 'login'
|
||||
user_id = session[:user_id]
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
class ObjectManagerAttributesController < ApplicationController
|
||||
before_filter :authentication_check
|
||||
|
||||
|
||||
# GET /object_manager_attributes_list
|
||||
def list
|
||||
return if deny_if_not_role(Z_ROLENAME_ADMIN)
|
||||
|
|
|
@ -112,7 +112,6 @@ class TicketsController < ApplicationController
|
|||
# get history of ticket
|
||||
history = ticket.history_get(true)
|
||||
|
||||
|
||||
# return result
|
||||
render json: history
|
||||
end
|
||||
|
@ -146,7 +145,6 @@ class TicketsController < ApplicationController
|
|||
assets = ticket.assets(assets)
|
||||
}
|
||||
|
||||
|
||||
ticket_ids_recent_viewed = []
|
||||
ticket_recent_view = RecentView.list( current_user, 8, 'Ticket' )
|
||||
ticket_recent_view.each {|item|
|
||||
|
|
|
@ -61,7 +61,6 @@ remove all not used model attributes of params
|
|||
|
||||
result = Model.param_cleanup(params, true)
|
||||
|
||||
|
||||
returns
|
||||
|
||||
result = params # params with valid attributes of model
|
||||
|
@ -796,7 +795,6 @@ class Model < ApplicationModel
|
|||
history_support
|
||||
end
|
||||
|
||||
|
||||
class Model < ApplicationModel
|
||||
history_support :ignore_attributes => { :article_count => true }
|
||||
end
|
||||
|
|
|
@ -7,12 +7,10 @@ class Channel::Facebook
|
|||
# def fetch(:oauth_token, :oauth_token_secret)
|
||||
def fetch
|
||||
|
||||
|
||||
end
|
||||
|
||||
def disconnect
|
||||
|
||||
|
||||
end
|
||||
|
||||
def send
|
||||
|
|
|
@ -121,7 +121,6 @@ returns
|
|||
{ ... },
|
||||
]
|
||||
|
||||
|
||||
return all history entries of an object and it's related history objects
|
||||
|
||||
history_list = History.list( 'Ticket', 123, true )
|
||||
|
@ -135,7 +134,6 @@ returns
|
|||
{ ... },
|
||||
]
|
||||
|
||||
|
||||
return all history entries of an object and it's assets
|
||||
|
||||
history = History.list( 'Ticket', 123, nil, true )
|
||||
|
|
|
@ -125,7 +125,6 @@ add a new attribute entry for an object
|
|||
ObjectManager::Attribute.create(data)
|
||||
end
|
||||
|
||||
|
||||
=begin
|
||||
|
||||
get the attribute model based on object and name
|
||||
|
|
|
@ -76,7 +76,6 @@ class Observer::Ticket::Notification < ActiveRecord::Observer
|
|||
# next if ticket is already deleted
|
||||
next if !ticket
|
||||
|
||||
|
||||
if !listObjects[ticket.id]
|
||||
listObjects[ticket.id] = {}
|
||||
end
|
||||
|
|
|
@ -39,7 +39,6 @@ class Observer::User::Geo < ActiveRecord::Observer
|
|||
self.geo_update(record)
|
||||
end
|
||||
|
||||
|
||||
# update geo data of user
|
||||
def geo_update(record)
|
||||
address = ''
|
||||
|
|
|
@ -104,7 +104,6 @@ returns
|
|||
self.first_response_diff_in_min = sla_selected.first_response_time - self.first_response_in_min
|
||||
end
|
||||
|
||||
|
||||
# update time
|
||||
last_update = self.last_contact_agent
|
||||
if !last_update
|
||||
|
@ -131,7 +130,6 @@ returns
|
|||
self.update_time_diff_in_min = sla_selected.update_time - self.update_time_in_min
|
||||
end
|
||||
|
||||
|
||||
# close time
|
||||
if sla_selected.close_time
|
||||
|
||||
|
|
|
@ -81,7 +81,6 @@ returns
|
|||
}
|
||||
filter[:priority_id] = priority_ids
|
||||
|
||||
|
||||
type_ids = []
|
||||
if params[:ticket]
|
||||
types = ['note', 'phone']
|
||||
|
|
|
@ -16,7 +16,6 @@ returns
|
|||
|
||||
result = [ticket_model1, ticket_model2]
|
||||
|
||||
|
||||
search tickets via search index
|
||||
|
||||
result = Ticket.search(
|
||||
|
@ -30,7 +29,6 @@ returns
|
|||
|
||||
result = [1,3,5,6,7]
|
||||
|
||||
|
||||
search tickets via database
|
||||
|
||||
result = Ticket.search(
|
||||
|
@ -45,7 +43,6 @@ returns
|
|||
|
||||
result = [1,3,5,6,7]
|
||||
|
||||
|
||||
=end
|
||||
|
||||
def search (params)
|
||||
|
|
|
@ -48,7 +48,6 @@ module Zammad
|
|||
'observer::_user::_geo',
|
||||
'observer::_organization::_ref_object_touch'
|
||||
|
||||
|
||||
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
||||
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
||||
# config.i18n.default_locale = :de
|
||||
|
|
|
@ -49,7 +49,6 @@ class CreateBase < ActiveRecord::Migration
|
|||
add_index :users, [:source]
|
||||
add_index :users, [:created_by_id]
|
||||
|
||||
|
||||
create_table :signatures do |t|
|
||||
t.column :name, :string, limit: 100, null: false
|
||||
t.column :body, :string, limit: 5000, null: true
|
||||
|
@ -61,7 +60,6 @@ class CreateBase < ActiveRecord::Migration
|
|||
end
|
||||
add_index :signatures, [:name], unique: true
|
||||
|
||||
|
||||
create_table :email_addresses do |t|
|
||||
t.column :realname, :string, limit: 250, null: false
|
||||
t.column :email, :string, limit: 250, null: false
|
||||
|
@ -73,7 +71,6 @@ class CreateBase < ActiveRecord::Migration
|
|||
end
|
||||
add_index :email_addresses, [:email], unique: true
|
||||
|
||||
|
||||
create_table :groups do |t|
|
||||
t.references :signature, null: true
|
||||
t.references :email_address, null: true
|
||||
|
@ -99,7 +96,6 @@ class CreateBase < ActiveRecord::Migration
|
|||
end
|
||||
add_index :roles, [:name], unique: true
|
||||
|
||||
|
||||
create_table :organizations do |t|
|
||||
t.column :name, :string, limit: 100, null: false
|
||||
t.column :shared, :boolean, null: false, default: true
|
||||
|
@ -126,7 +122,6 @@ class CreateBase < ActiveRecord::Migration
|
|||
t.integer :organization_id
|
||||
end
|
||||
|
||||
|
||||
create_table :authorizations do |t|
|
||||
t.string :provider, limit: 250, null: false
|
||||
t.string :uid, limit: 250, null: false
|
||||
|
@ -140,7 +135,6 @@ class CreateBase < ActiveRecord::Migration
|
|||
add_index :authorizations, [:user_id]
|
||||
add_index :authorizations, [:username]
|
||||
|
||||
|
||||
create_table :translations do |t|
|
||||
t.column :locale, :string, limit: 10, null: false
|
||||
t.column :source, :string, limit: 255, null: false
|
||||
|
@ -153,7 +147,6 @@ class CreateBase < ActiveRecord::Migration
|
|||
add_index :translations, [:source]
|
||||
add_index :translations, [:locale]
|
||||
|
||||
|
||||
create_table :object_lookups do |t|
|
||||
t.column :name, :string, limit: 250, null: false
|
||||
t.timestamps
|
||||
|
@ -166,7 +159,6 @@ class CreateBase < ActiveRecord::Migration
|
|||
end
|
||||
add_index :type_lookups, [:name], unique: true
|
||||
|
||||
|
||||
create_table :tokens do |t|
|
||||
t.references :user, null: false
|
||||
t.string :name, limit: 100, null: false
|
||||
|
@ -177,7 +169,6 @@ class CreateBase < ActiveRecord::Migration
|
|||
add_index :tokens, [:name, :action], unique: true
|
||||
add_index :tokens, :created_at
|
||||
|
||||
|
||||
create_table :packages do |t|
|
||||
t.column :name, :string, limit: 250, null: false
|
||||
t.column :version, :string, limit: 50, null: false
|
||||
|
@ -209,7 +200,6 @@ class CreateBase < ActiveRecord::Migration
|
|||
add_index :taskbars, [:user_id]
|
||||
add_index :taskbars, [:client_id]
|
||||
|
||||
|
||||
create_table :tags do |t|
|
||||
t.references :tag_item, null: false
|
||||
t.references :tag_object, null: false
|
||||
|
@ -232,7 +222,6 @@ class CreateBase < ActiveRecord::Migration
|
|||
end
|
||||
add_index :tag_items, [:name], unique: true
|
||||
|
||||
|
||||
create_table :recent_views do |t|
|
||||
t.references :recent_view_object, null: false
|
||||
t.column :o_id, :integer, null: false
|
||||
|
@ -244,7 +233,6 @@ class CreateBase < ActiveRecord::Migration
|
|||
add_index :recent_views, [:created_at]
|
||||
add_index :recent_views, [:recent_view_object_id]
|
||||
|
||||
|
||||
create_table :activity_streams do |t|
|
||||
t.references :activity_stream_type, null: false
|
||||
t.references :activity_stream_object, null: false
|
||||
|
@ -306,7 +294,6 @@ class CreateBase < ActiveRecord::Migration
|
|||
end
|
||||
add_index :history_attributes, [:name], unique: true
|
||||
|
||||
|
||||
create_table :settings do |t|
|
||||
t.column :title, :string, limit: 200, null: false
|
||||
t.column :name, :string, limit: 200, null: false
|
||||
|
|
|
@ -620,7 +620,6 @@ class UpdateObjectManager2 < ActiveRecord::Migration
|
|||
updated_by_id: 1,
|
||||
)
|
||||
|
||||
|
||||
ObjectManager::Attribute.add(
|
||||
object: 'Organization',
|
||||
name: 'name',
|
||||
|
|
|
@ -154,8 +154,6 @@ Setting.create_if_not_exists(
|
|||
frontend: true
|
||||
)
|
||||
|
||||
|
||||
|
||||
Setting.create_if_not_exists(
|
||||
title: 'Storage Mechanism',
|
||||
name: 'storage',
|
||||
|
@ -912,7 +910,6 @@ Setting.create_if_not_exists(
|
|||
frontend: true
|
||||
)
|
||||
|
||||
|
||||
Setting.create_if_not_exists(
|
||||
title: 'Enable Ticket View/Update',
|
||||
name: 'customer_ticket_view',
|
||||
|
@ -1244,7 +1241,6 @@ Setting.create_if_not_exists(
|
|||
frontend: false
|
||||
)
|
||||
|
||||
|
||||
email_address = EmailAddress.create_if_not_exists(
|
||||
id: 1,
|
||||
realname: 'Zammad',
|
||||
|
|
|
@ -151,7 +151,6 @@ class String
|
|||
chr_orig
|
||||
}
|
||||
|
||||
|
||||
# remove tailing empty spaces
|
||||
string.gsub!(/\s+\n$/, "\n")
|
||||
|
||||
|
|
|
@ -201,7 +201,6 @@ module Import::OTRS
|
|||
return
|
||||
end
|
||||
|
||||
|
||||
def self.ticket_diff()
|
||||
url = 'public.pl?Action=Export;Type=TicketDiff;Limit=30'
|
||||
response = request( url )
|
||||
|
|
|
@ -10,7 +10,6 @@ module Import::OTRS2
|
|||
|
||||
{ some json structure }
|
||||
|
||||
|
||||
result = request_json( :Subaction => 'List' )
|
||||
|
||||
return
|
||||
|
@ -950,7 +949,6 @@ module Import::OTRS2
|
|||
UserPw: :password,
|
||||
};
|
||||
|
||||
|
||||
records.each { |user|
|
||||
_set_valid(user)
|
||||
|
||||
|
@ -1177,12 +1175,10 @@ module Import::OTRS2
|
|||
}
|
||||
end
|
||||
|
||||
|
||||
# sync settings
|
||||
|
||||
def self.setting(records)
|
||||
|
||||
|
||||
records.each { |setting|
|
||||
|
||||
# fqdn
|
||||
|
@ -1229,8 +1225,6 @@ module Import::OTRS2
|
|||
}
|
||||
end
|
||||
|
||||
|
||||
|
||||
# log
|
||||
|
||||
def self.log(message)
|
||||
|
|
|
@ -244,7 +244,6 @@ return true if backend is configured
|
|||
true
|
||||
end
|
||||
|
||||
|
||||
private
|
||||
|
||||
def self.build_url( type = nil, o_id = nil )
|
||||
|
|
|
@ -8,7 +8,6 @@ class Sessions::Backend::Collections
|
|||
@backends = self.backend
|
||||
end
|
||||
|
||||
|
||||
def push
|
||||
results = []
|
||||
@backends.each {|backend|
|
||||
|
|
|
@ -43,7 +43,6 @@ class Sessions::Backend::TicketCreate
|
|||
|
||||
return if !ticket_create_attributes
|
||||
|
||||
|
||||
data = {
|
||||
assets: ticket_create_attributes[:assets],
|
||||
form_meta: {
|
||||
|
@ -52,7 +51,6 @@ class Sessions::Backend::TicketCreate
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
if !@client
|
||||
return {
|
||||
collection: 'ticket_create_attributes',
|
||||
|
|
|
@ -122,7 +122,6 @@ put working hours matrix and timezone in function, returns UTC working hours mat
|
|||
return ((end_time - start_time) / 60 ).round
|
||||
end
|
||||
|
||||
|
||||
working_hours = self.working_hours(start_time, config, timezone)
|
||||
|
||||
week_day_map = {
|
||||
|
@ -145,7 +144,6 @@ put working hours matrix and timezone in function, returns UTC working hours mat
|
|||
year = start_time.year
|
||||
hour = start_time.hour
|
||||
|
||||
|
||||
# check if it's vacation day
|
||||
if config
|
||||
if config['holidays']
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#!/usr/bin/env ruby
|
||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
||||
|
||||
|
||||
$LOAD_PATH << './lib'
|
||||
require 'rubygems'
|
||||
require 'daemons'
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#!/usr/bin/env ruby
|
||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
||||
|
||||
|
||||
$LOAD_PATH << './lib'
|
||||
require 'rubygems'
|
||||
require 'eventmachine'
|
||||
|
|
|
@ -81,8 +81,6 @@ class AgentOrganizationProfileTest < TestCase
|
|||
)
|
||||
tasks_close_all()
|
||||
|
||||
|
||||
|
||||
# work with two browser windows
|
||||
message = 'comment 1 ' + rand(99_999_999_999_999_999).to_s
|
||||
|
||||
|
|
|
@ -54,8 +54,6 @@ class AgentTicketActionLevel0Test < TestCase
|
|||
)
|
||||
tasks_close_all( discard_changes: true )
|
||||
|
||||
|
||||
|
||||
# test with two browser windows
|
||||
random = 'text_II_module_test_' + rand(99_999_999).to_s
|
||||
|
||||
|
@ -145,7 +143,6 @@ class AgentTicketActionLevel0Test < TestCase
|
|||
)
|
||||
sleep 2
|
||||
|
||||
|
||||
set(
|
||||
browser: browser2,
|
||||
css: '.active .newTicket input[name="customer_id_completion"]',
|
||||
|
|
|
@ -93,8 +93,6 @@ class AgentTicketActionLevel1Test < TestCase
|
|||
# close task/cleanup
|
||||
tasks_close_all()
|
||||
|
||||
|
||||
|
||||
# merge ticket with open tabs
|
||||
ticket3 = ticket_create(
|
||||
data: {
|
||||
|
|
|
@ -148,7 +148,6 @@ class AgentTicketActionsLevel3Test < TestCase
|
|||
no_quote: true,
|
||||
)
|
||||
|
||||
|
||||
# reload instances, verify again
|
||||
reload(
|
||||
browser: browser1,
|
||||
|
|
|
@ -109,7 +109,6 @@ class AgentTicketActionLevel5Test < TestCase
|
|||
no_quote: true,
|
||||
)
|
||||
|
||||
|
||||
# select create channel
|
||||
click(
|
||||
css: '.active [data-type="email-out"]',
|
||||
|
@ -135,7 +134,6 @@ class AgentTicketActionLevel5Test < TestCase
|
|||
no_quote: true,
|
||||
)
|
||||
|
||||
|
||||
# select group
|
||||
select(
|
||||
css: '.active [name="group_id"]',
|
||||
|
|
|
@ -107,7 +107,6 @@ class AgentTicketActionLevel6Test < TestCase
|
|||
value: 'test 6 - ticket 1-1',
|
||||
)
|
||||
|
||||
|
||||
#
|
||||
# ticket customer change checks
|
||||
#
|
||||
|
@ -201,7 +200,6 @@ class AgentTicketActionLevel6Test < TestCase
|
|||
# form change/reset checks
|
||||
#
|
||||
|
||||
|
||||
# some form reset checks
|
||||
end
|
||||
end
|
||||
|
|
|
@ -77,8 +77,6 @@ class AgentUserProfileTest < TestCase
|
|||
)
|
||||
tasks_close_all()
|
||||
|
||||
|
||||
|
||||
# work with two browser windows
|
||||
message = 'comment 1 ' + rand(99_999_999_999_999_999).to_s
|
||||
|
||||
|
|
|
@ -60,7 +60,6 @@ class SignupPasswordChangeAndResetTest < TestCase
|
|||
)
|
||||
click( css: '.content .btn--primary' )
|
||||
|
||||
|
||||
watch_for(
|
||||
css: 'body',
|
||||
value: 'current password is wrong',
|
||||
|
|
|
@ -787,7 +787,6 @@ wait untill text in selector disabppears
|
|||
:timeout => '16', # in sec, default 16
|
||||
)
|
||||
|
||||
|
||||
=end
|
||||
|
||||
def watch_for_disappear(params = {})
|
||||
|
@ -1087,7 +1086,6 @@ wait untill text in selector disabppears
|
|||
instance = params[:browser] || @browser
|
||||
data = params[:data]
|
||||
|
||||
|
||||
if data[:title]
|
||||
#element = instance.find_elements( { :css => '.content.active .page-header .ticket-title-update' } )[0]
|
||||
#element.clear
|
||||
|
|
|
@ -260,7 +260,6 @@ class ElasticsearchTest < ActiveSupport::TestCase
|
|||
assert(result[0], 'record 1')
|
||||
assert_equal(result[0].id, ticket1.id)
|
||||
|
||||
|
||||
# search for not indexed attachment
|
||||
result = Ticket.search(
|
||||
current_user: agent,
|
||||
|
@ -276,7 +275,6 @@ class ElasticsearchTest < ActiveSupport::TestCase
|
|||
)
|
||||
assert(!result[0], 'record 1')
|
||||
|
||||
|
||||
# search for ticket with no permissions
|
||||
result = Ticket.search(
|
||||
current_user: agent,
|
||||
|
@ -286,7 +284,6 @@ class ElasticsearchTest < ActiveSupport::TestCase
|
|||
assert(result.empty?, 'result should be empty')
|
||||
assert(!result[0], 'record 1')
|
||||
|
||||
|
||||
# search as customer1
|
||||
result = Ticket.search(
|
||||
current_user: customer1,
|
||||
|
|
|
@ -15,7 +15,6 @@ class GeoIpTest < ActiveSupport::TestCase
|
|||
assert_equal(nil, result['latitude'])
|
||||
assert_equal(nil, result['longitude'])
|
||||
|
||||
|
||||
result = GeoIp.location( '195.65.29.254' )
|
||||
assert(result)
|
||||
assert_equal('Switzerland', result['country_name'])
|
||||
|
@ -25,7 +24,6 @@ class GeoIpTest < ActiveSupport::TestCase
|
|||
assert_equal(47.4299, result['latitude'])
|
||||
assert_equal(8.465100000000007, result['longitude'])
|
||||
|
||||
|
||||
result = GeoIp.location( '134.109.140.74' )
|
||||
assert(result)
|
||||
assert_equal('Germany', result['country_name'])
|
||||
|
@ -35,7 +33,6 @@ class GeoIpTest < ActiveSupport::TestCase
|
|||
assert_equal(50.83330000000001, result['latitude'])
|
||||
assert_equal(12.916699999999992, result['longitude'])
|
||||
|
||||
|
||||
result = GeoIp.location( '46.253.55.170' )
|
||||
assert(result)
|
||||
assert_equal('Germany', result['country_name'])
|
||||
|
@ -45,7 +42,6 @@ class GeoIpTest < ActiveSupport::TestCase
|
|||
assert_equal(51.5, result['latitude'])
|
||||
assert_equal(12.0, result['longitude'])
|
||||
|
||||
|
||||
result = GeoIp.location( '169.229.216.200' )
|
||||
assert(result)
|
||||
assert_equal('United States', result['country_name'])
|
||||
|
|
|
@ -55,7 +55,6 @@ class OtrsImportTest < ActiveSupport::TestCase
|
|||
assert_equal( 'agent-1@example.com', user1.email )
|
||||
assert_equal( true, user1.active )
|
||||
|
||||
|
||||
assert( user1.roles.include?( role_agent ) )
|
||||
assert( !user1.roles.include?( role_admin ) )
|
||||
assert( !user1.roles.include?( role_customer ) )
|
||||
|
@ -67,7 +66,6 @@ class OtrsImportTest < ActiveSupport::TestCase
|
|||
assert( !user1.groups.include?( group_dasa ) )
|
||||
assert( user1.groups.include?( group_raw ) )
|
||||
|
||||
|
||||
user2 = User.find(3)
|
||||
assert_equal( 'agent-2 firstname äöüß', user2.firstname )
|
||||
assert_equal( 'agent-2 lastname äöüß', user2.lastname )
|
||||
|
|
|
@ -103,8 +103,6 @@ class UserAgentTest < ActiveSupport::TestCase
|
|||
assert_equal('404', result.code)
|
||||
assert_equal(NilClass, result.body.class)
|
||||
|
||||
|
||||
|
||||
# with http basic auth
|
||||
|
||||
# get / 200
|
||||
|
@ -208,7 +206,6 @@ class UserAgentTest < ActiveSupport::TestCase
|
|||
assert_equal('401', result.code)
|
||||
assert_equal(NilClass, result.body.class)
|
||||
|
||||
|
||||
# delete / 200
|
||||
result = UserAgent.delete(
|
||||
"#{host}/test_basic_auth/delete/1",
|
||||
|
@ -253,7 +250,6 @@ class UserAgentTest < ActiveSupport::TestCase
|
|||
assert(result.body =~ /"abc"/)
|
||||
assert(result.body =~ /"text\/plain"/)
|
||||
|
||||
|
||||
# get / 301
|
||||
result = UserAgent.request(
|
||||
"#{host}/test_basic_auth/redirect",
|
||||
|
@ -270,7 +266,6 @@ class UserAgentTest < ActiveSupport::TestCase
|
|||
assert(result.body =~ /"abc"/)
|
||||
assert(result.body =~ /"text\/plain"/)
|
||||
|
||||
|
||||
# get / 401
|
||||
result = UserAgent.request(
|
||||
"#{host}/test_basic_auth/redirect",
|
||||
|
@ -361,7 +356,6 @@ class UserAgentTest < ActiveSupport::TestCase
|
|||
|
||||
end
|
||||
|
||||
|
||||
# check
|
||||
test 'check not existing' do
|
||||
|
||||
|
@ -384,7 +378,6 @@ class UserAgentTest < ActiveSupport::TestCase
|
|||
assert_equal(NilClass, result.body.class)
|
||||
end
|
||||
|
||||
|
||||
# check
|
||||
test 'check timeout' do
|
||||
|
||||
|
|
|
@ -75,7 +75,6 @@ class AaaStringTest < ActiveSupport::TestCase
|
|||
result = "test col \ntest 4711"
|
||||
assert_equal( result, html.html2text )
|
||||
|
||||
|
||||
html = "<!-- some comment -->
|
||||
<div>
|
||||
test<br><br><br>\n<br>\n<br>\n
|
||||
|
@ -104,7 +103,6 @@ you
|
|||
-----&'
|
||||
assert_equal( should, html.html2text )
|
||||
|
||||
|
||||
html = ' <ul><li>#1</li><li>#2</li></ul>'
|
||||
should = '* #1
|
||||
* #2'
|
||||
|
|
|
@ -88,7 +88,6 @@ class ActivityStreamTest < ActiveSupport::TestCase
|
|||
ticket = nil
|
||||
article = nil
|
||||
|
||||
|
||||
ticket = Ticket.create( test[:create][:ticket] )
|
||||
test[:check][0][:o_id] = ticket.id
|
||||
test[:check][2][:o_id] = ticket.id
|
||||
|
@ -221,7 +220,6 @@ class ActivityStreamTest < ActiveSupport::TestCase
|
|||
}
|
||||
end
|
||||
|
||||
|
||||
test 'user with update check false' do
|
||||
tests = [
|
||||
|
||||
|
|
|
@ -28,7 +28,6 @@ class DbAutoIncrementTest < ActiveSupport::TestCase
|
|||
assert_equal( Ticket::StateType.to_s, state_type.class.to_s )
|
||||
assert_equal( 'unit test 1 _ should be updated', state_type.name )
|
||||
|
||||
|
||||
Ticket::State.create_if_not_exists( id: 210, name: 'unit test 1', state_type_id: Ticket::StateType.where(name: 'unit test 1 _ should be updated').first.id, updated_by_id: 1, created_by_id: 1 )
|
||||
state = Ticket::State.where( name: 'unit test 1' ).first
|
||||
assert_equal( Ticket::State.to_s, state.class.to_s )
|
||||
|
@ -48,8 +47,6 @@ class DbAutoIncrementTest < ActiveSupport::TestCase
|
|||
assert_equal( Ticket::State.to_s, state.class.to_s )
|
||||
assert_equal( 'unit test 1 _ should be updated', state.name )
|
||||
|
||||
|
||||
|
||||
Setting.set('system_init_done', setting_backup)
|
||||
|
||||
end
|
||||
|
|
|
@ -13,7 +13,6 @@ class EmailBuildTest < ActiveSupport::TestCase
|
|||
assert( result =~ /font-family/, 'test 1')
|
||||
assert( result =~ /<b>test<\/b>/, 'test 1')
|
||||
|
||||
|
||||
html = 'invalid <!DOCTYPE html><html><b>test</b></html>'
|
||||
result = Channel::EmailBuild.html_complete_check( html )
|
||||
|
||||
|
|
|
@ -353,7 +353,6 @@ class HistoryTest < ActiveSupport::TestCase
|
|||
}
|
||||
end
|
||||
|
||||
|
||||
def history_check( history_list, history_check )
|
||||
# puts history_list.inspect
|
||||
history_check.each { |check_item|
|
||||
|
|
|
@ -12,7 +12,6 @@ class ObjectTypeLookupTest < ActiveSupport::TestCase
|
|||
assert( object_lookup_name, 'first by_id' )
|
||||
assert_equal( object_lookup_name, 'SomeObject' )
|
||||
|
||||
|
||||
object_lookup_id2 = ObjectLookup.by_name( 'Some_Object' )
|
||||
assert( object_lookup_id2, 'by_name - Some_Object' )
|
||||
|
||||
|
@ -20,7 +19,6 @@ class ObjectTypeLookupTest < ActiveSupport::TestCase
|
|||
assert( object_lookup_name2, 'by_id - Some_Object' )
|
||||
assert_equal( object_lookup_name2, 'Some_Object' )
|
||||
|
||||
|
||||
object_lookup_id3 = ObjectLookup.by_name( 'SomeObject' )
|
||||
assert( object_lookup_id3, 'by_name 2 - SomeObject' )
|
||||
|
||||
|
@ -41,7 +39,6 @@ class ObjectTypeLookupTest < ActiveSupport::TestCase
|
|||
assert( type_lookup_name, 'first by_id' )
|
||||
assert_equal( type_lookup_name, 'SomeType' )
|
||||
|
||||
|
||||
type_lookup_id2 = TypeLookup.by_name( 'Some_Type' )
|
||||
assert( type_lookup_id2, 'by_name - Some_Type' )
|
||||
|
||||
|
@ -49,7 +46,6 @@ class ObjectTypeLookupTest < ActiveSupport::TestCase
|
|||
assert( type_lookup_name2, 'by_id - Some_Type' )
|
||||
assert_equal( type_lookup_name2, 'Some_Type' )
|
||||
|
||||
|
||||
type_lookup_id3 = TypeLookup.by_name( 'SomeType' )
|
||||
assert( type_lookup_id3, 'by_name 2 - SomeType' )
|
||||
|
||||
|
|
|
@ -28,7 +28,6 @@ class RecentViewTest < ActiveSupport::TestCase
|
|||
user1 = User.find(2)
|
||||
RecentView.user_log_destroy(user1)
|
||||
|
||||
|
||||
RecentView.log( ticket1.class.to_s, ticket1.id, user1 )
|
||||
sleep 1
|
||||
RecentView.log( ticket2.class.to_s, ticket2.id, user1 )
|
||||
|
@ -68,7 +67,6 @@ class RecentViewTest < ActiveSupport::TestCase
|
|||
list = RecentView.list( user )
|
||||
assert( !list[0], 'check if recent view list is empty' )
|
||||
|
||||
|
||||
# log entry of not existing record
|
||||
RecentView.user_log_destroy(user)
|
||||
RecentView.log( 'User', 99_999_999, user )
|
||||
|
@ -77,7 +75,6 @@ class RecentViewTest < ActiveSupport::TestCase
|
|||
list = RecentView.list( user )
|
||||
assert( !list[0], 'check if recent view list is empty' )
|
||||
|
||||
|
||||
# log entry of not existing model with permission check
|
||||
RecentView.user_log_destroy(user)
|
||||
RecentView.log( 'Overview', 99_999_999, user )
|
||||
|
@ -139,7 +136,6 @@ class RecentViewTest < ActiveSupport::TestCase
|
|||
list = RecentView.list( agent )
|
||||
assert( !list[0], 'check if recent view list is empty' )
|
||||
|
||||
|
||||
# access for customer via customer id
|
||||
ticket1 = Ticket.create(
|
||||
title: 'RecentViewTest 1 some title äöüß',
|
||||
|
@ -162,7 +158,6 @@ class RecentViewTest < ActiveSupport::TestCase
|
|||
assert( list[0]['object'], 'Ticket' )
|
||||
assert( !list[1], 'check if recent view list is empty' )
|
||||
|
||||
|
||||
# log entry
|
||||
organization = Organization.find(1)
|
||||
RecentView.user_log_destroy(customer)
|
||||
|
@ -172,7 +167,6 @@ class RecentViewTest < ActiveSupport::TestCase
|
|||
list = RecentView.list( customer )
|
||||
assert( !list[0], 'check if recent view list is empty' )
|
||||
|
||||
|
||||
# log entry
|
||||
organization = Organization.find(1)
|
||||
RecentView.user_log_destroy(agent)
|
||||
|
|
|
@ -147,7 +147,6 @@ class RestTest < ActiveSupport::TestCase
|
|||
assert_equal( request[:response].code, '401' )
|
||||
assert_equal( request[:data].class, NilClass)
|
||||
|
||||
|
||||
# /organizations
|
||||
|
||||
# index
|
||||
|
@ -197,7 +196,6 @@ class RestTest < ActiveSupport::TestCase
|
|||
assert_equal( request[:response].code, '401' )
|
||||
assert_equal( request[:data].class, NilClass)
|
||||
|
||||
|
||||
# packages
|
||||
request = get( 'rest-admin@example.com', 'adminpw', '/api/v1/packages' )
|
||||
assert_equal( request[:response].code, '200' )
|
||||
|
|
|
@ -115,7 +115,6 @@ class SessionEnhancedTest < ActiveSupport::TestCase
|
|||
assert_equal( 'ws:login', messages[0]['event'], 'messages 1')
|
||||
assert_equal( true, messages[0]['data']['success'], 'messages 1')
|
||||
|
||||
|
||||
# broadcast to all clients
|
||||
Sessions.broadcast( { msg: 'ooo123123123123123123'} )
|
||||
messages = Sessions.queue(client_id1)
|
||||
|
|
|
@ -220,8 +220,6 @@ class TicketNotificationTest < ActiveSupport::TestCase
|
|||
assert_equal( 1, notification_check(ticket2, agent1), ticket2.id )
|
||||
assert_equal( 0, notification_check(ticket2, agent2), ticket2.id )
|
||||
|
||||
|
||||
|
||||
# create ticket with agent2 and agent1 as owner
|
||||
ticket3 = Ticket.create(
|
||||
title: 'some notification test 3',
|
||||
|
@ -287,7 +285,6 @@ class TicketNotificationTest < ActiveSupport::TestCase
|
|||
assert_equal( 2, notification_check(ticket3, agent1), ticket3.id )
|
||||
assert_equal( 0, notification_check(ticket3, agent2), ticket3.id )
|
||||
|
||||
|
||||
# update article / not notification should be sent
|
||||
article_inbound.internal = true
|
||||
article_inbound.save
|
||||
|
@ -301,7 +298,6 @@ class TicketNotificationTest < ActiveSupport::TestCase
|
|||
assert_equal( 2, notification_check(ticket3, agent1), ticket3.id )
|
||||
assert_equal( 0, notification_check(ticket3, agent2), ticket3.id )
|
||||
|
||||
|
||||
delete = ticket1.destroy
|
||||
assert( delete, 'ticket1 destroy' )
|
||||
|
||||
|
@ -373,7 +369,6 @@ class TicketNotificationTest < ActiveSupport::TestCase
|
|||
|
||||
end
|
||||
|
||||
|
||||
test 'ticket notification template' do
|
||||
|
||||
# create ticket in group
|
||||
|
@ -536,8 +531,6 @@ class TicketNotificationTest < ActiveSupport::TestCase
|
|||
template = bg.template_update(agent2, ticket1, article, human_changes)
|
||||
puts "t2 #{template.inspect}"
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
def notification_check(ticket, recipient)
|
||||
|
|
|
@ -286,7 +286,6 @@ class TicketSlaTest < ActiveSupport::TestCase
|
|||
delete = ticket.destroy
|
||||
assert( delete, 'ticket destroy' )
|
||||
|
||||
|
||||
ticket = Ticket.create(
|
||||
title: 'some title äöüß',
|
||||
group: Group.lookup( name: 'Users'),
|
||||
|
@ -591,7 +590,6 @@ class TicketSlaTest < ActiveSupport::TestCase
|
|||
)
|
||||
assert( ticket, 'ticket created' )
|
||||
|
||||
|
||||
# set ticket from 11:30 to closed
|
||||
History.add(
|
||||
history_type: 'updated',
|
||||
|
@ -642,7 +640,6 @@ class TicketSlaTest < ActiveSupport::TestCase
|
|||
delete = ticket.destroy
|
||||
assert( delete, 'ticket destroy' )
|
||||
|
||||
|
||||
# test Ticket created in state pending, changed state to openen, back to pending and closed
|
||||
ticket = Ticket.create(
|
||||
title: 'some title äöüß3',
|
||||
|
|
|
@ -100,7 +100,6 @@ class TicketTest < ActiveSupport::TestCase
|
|||
assert_equal( ticket.first_response.to_s, article_outbound.created_at.to_s, 'ticket.first_response verify - state update' )
|
||||
assert( ticket.close_time, 'ticket.close_time verify - state update' )
|
||||
|
||||
|
||||
# set pending time
|
||||
ticket.state_id = Ticket::State.where(name: 'pending reminder').first.id
|
||||
ticket.pending_time = Time.parse('1977-10-27 22:00:00 +0000')
|
||||
|
@ -110,7 +109,6 @@ class TicketTest < ActiveSupport::TestCase
|
|||
assert_equal( ticket.state.name, 'pending reminder', 'state verify' )
|
||||
assert_equal( ticket.pending_time, Time.parse('1977-10-27 22:00:00 +0000'), 'pending_time verify' )
|
||||
|
||||
|
||||
# reset pending state, should also reset pending time
|
||||
ticket.state_id = Ticket::State.where(name: 'closed').first.id
|
||||
ticket.save
|
||||
|
@ -119,12 +117,10 @@ class TicketTest < ActiveSupport::TestCase
|
|||
assert_equal( ticket.state.name, 'closed', 'state verify' )
|
||||
assert_equal( ticket.pending_time, nil )
|
||||
|
||||
|
||||
delete = ticket.destroy
|
||||
assert( delete, 'ticket destroy' )
|
||||
end
|
||||
|
||||
|
||||
test 'ticket latest change' do
|
||||
ticket1 = Ticket.create(
|
||||
title: 'latest change 1',
|
||||
|
|
|
@ -335,7 +335,6 @@ class WorkingTimeTest < ActiveSupport::TestCase
|
|||
},
|
||||
},
|
||||
|
||||
|
||||
# test 6
|
||||
{
|
||||
start: '2012-12-17 08:00:00',
|
||||
|
|
Loading…
Reference in a new issue