Applied rubocop Style/EmptyLines.

This commit is contained in:
Martin Edenhofer 2015-04-27 16:29:28 +02:00
parent bd1db72b9b
commit e474ac197a
53 changed files with 0 additions and 127 deletions

View file

@ -139,7 +139,6 @@ class IcalTicketsController < ApplicationController
events_data events_data
end end
def escalation_events_data_get def escalation_events_data_get
condition = [ condition = [

View file

@ -5,7 +5,6 @@ class ImportOtrsController < ApplicationController
def url_check def url_check
return if setup_done_response return if setup_done_response
# validate # validate
if !params[:url] ||params[:url] !~ /^(http|https):\/\/.+?$/ if !params[:url] ||params[:url] !~ /^(http|https):\/\/.+?$/
render json: { render json: {
@ -63,7 +62,6 @@ class ImportOtrsController < ApplicationController
end end
} }
# return result # return result
render json: { render json: {
result: 'invalid', result: 'invalid',

View file

@ -53,7 +53,6 @@ class LongPollingController < ApplicationController
Sessions.send( client_id, { event: 'spool:sent', data: { timestamp: Time.now.utc.to_i } } ) Sessions.send( client_id, { event: 'spool:sent', data: { timestamp: Time.now.utc.to_i } } )
end end
# receive message # receive message
if params['data']['action'] == 'login' if params['data']['action'] == 'login'
user_id = session[:user_id] user_id = session[:user_id]

View file

@ -3,7 +3,6 @@
class ObjectManagerAttributesController < ApplicationController class ObjectManagerAttributesController < ApplicationController
before_filter :authentication_check before_filter :authentication_check
# GET /object_manager_attributes_list # GET /object_manager_attributes_list
def list def list
return if deny_if_not_role(Z_ROLENAME_ADMIN) return if deny_if_not_role(Z_ROLENAME_ADMIN)

View file

@ -112,7 +112,6 @@ class TicketsController < ApplicationController
# get history of ticket # get history of ticket
history = ticket.history_get(true) history = ticket.history_get(true)
# return result # return result
render json: history render json: history
end end
@ -146,7 +145,6 @@ class TicketsController < ApplicationController
assets = ticket.assets(assets) assets = ticket.assets(assets)
} }
ticket_ids_recent_viewed = [] ticket_ids_recent_viewed = []
ticket_recent_view = RecentView.list( current_user, 8, 'Ticket' ) ticket_recent_view = RecentView.list( current_user, 8, 'Ticket' )
ticket_recent_view.each {|item| ticket_recent_view.each {|item|

View file

@ -61,7 +61,6 @@ remove all not used model attributes of params
result = Model.param_cleanup(params, true) result = Model.param_cleanup(params, true)
returns returns
result = params # params with valid attributes of model result = params # params with valid attributes of model
@ -796,7 +795,6 @@ class Model < ApplicationModel
history_support history_support
end end
class Model < ApplicationModel class Model < ApplicationModel
history_support :ignore_attributes => { :article_count => true } history_support :ignore_attributes => { :article_count => true }
end end

View file

@ -7,12 +7,10 @@ class Channel::Facebook
# def fetch(:oauth_token, :oauth_token_secret) # def fetch(:oauth_token, :oauth_token_secret)
def fetch def fetch
end end
def disconnect def disconnect
end end
def send def send

View file

@ -121,7 +121,6 @@ returns
{ ... }, { ... },
] ]
return all history entries of an object and it's related history objects return all history entries of an object and it's related history objects
history_list = History.list( 'Ticket', 123, true ) history_list = History.list( 'Ticket', 123, true )
@ -135,7 +134,6 @@ returns
{ ... }, { ... },
] ]
return all history entries of an object and it's assets return all history entries of an object and it's assets
history = History.list( 'Ticket', 123, nil, true ) history = History.list( 'Ticket', 123, nil, true )

View file

@ -125,7 +125,6 @@ add a new attribute entry for an object
ObjectManager::Attribute.create(data) ObjectManager::Attribute.create(data)
end end
=begin =begin
get the attribute model based on object and name get the attribute model based on object and name

View file

@ -76,7 +76,6 @@ class Observer::Ticket::Notification < ActiveRecord::Observer
# next if ticket is already deleted # next if ticket is already deleted
next if !ticket next if !ticket
if !listObjects[ticket.id] if !listObjects[ticket.id]
listObjects[ticket.id] = {} listObjects[ticket.id] = {}
end end

View file

@ -39,7 +39,6 @@ class Observer::User::Geo < ActiveRecord::Observer
self.geo_update(record) self.geo_update(record)
end end
# update geo data of user # update geo data of user
def geo_update(record) def geo_update(record)
address = '' address = ''

View file

@ -104,7 +104,6 @@ returns
self.first_response_diff_in_min = sla_selected.first_response_time - self.first_response_in_min self.first_response_diff_in_min = sla_selected.first_response_time - self.first_response_in_min
end end
# update time # update time
last_update = self.last_contact_agent last_update = self.last_contact_agent
if !last_update if !last_update
@ -131,7 +130,6 @@ returns
self.update_time_diff_in_min = sla_selected.update_time - self.update_time_in_min self.update_time_diff_in_min = sla_selected.update_time - self.update_time_in_min
end end
# close time # close time
if sla_selected.close_time if sla_selected.close_time

View file

@ -81,7 +81,6 @@ returns
} }
filter[:priority_id] = priority_ids filter[:priority_id] = priority_ids
type_ids = [] type_ids = []
if params[:ticket] if params[:ticket]
types = ['note', 'phone'] types = ['note', 'phone']

View file

@ -16,7 +16,6 @@ returns
result = [ticket_model1, ticket_model2] result = [ticket_model1, ticket_model2]
search tickets via search index search tickets via search index
result = Ticket.search( result = Ticket.search(
@ -30,7 +29,6 @@ returns
result = [1,3,5,6,7] result = [1,3,5,6,7]
search tickets via database search tickets via database
result = Ticket.search( result = Ticket.search(
@ -45,7 +43,6 @@ returns
result = [1,3,5,6,7] result = [1,3,5,6,7]
=end =end
def search (params) def search (params)

View file

@ -48,7 +48,6 @@ module Zammad
'observer::_user::_geo', 'observer::_user::_geo',
'observer::_organization::_ref_object_touch' 'observer::_organization::_ref_object_touch'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. # 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.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de # config.i18n.default_locale = :de

View file

@ -49,7 +49,6 @@ class CreateBase < ActiveRecord::Migration
add_index :users, [:source] add_index :users, [:source]
add_index :users, [:created_by_id] add_index :users, [:created_by_id]
create_table :signatures do |t| create_table :signatures do |t|
t.column :name, :string, limit: 100, null: false t.column :name, :string, limit: 100, null: false
t.column :body, :string, limit: 5000, null: true t.column :body, :string, limit: 5000, null: true
@ -61,7 +60,6 @@ class CreateBase < ActiveRecord::Migration
end end
add_index :signatures, [:name], unique: true add_index :signatures, [:name], unique: true
create_table :email_addresses do |t| create_table :email_addresses do |t|
t.column :realname, :string, limit: 250, null: false t.column :realname, :string, limit: 250, null: false
t.column :email, :string, limit: 250, null: false t.column :email, :string, limit: 250, null: false
@ -73,7 +71,6 @@ class CreateBase < ActiveRecord::Migration
end end
add_index :email_addresses, [:email], unique: true add_index :email_addresses, [:email], unique: true
create_table :groups do |t| create_table :groups do |t|
t.references :signature, null: true t.references :signature, null: true
t.references :email_address, null: true t.references :email_address, null: true
@ -99,7 +96,6 @@ class CreateBase < ActiveRecord::Migration
end end
add_index :roles, [:name], unique: true add_index :roles, [:name], unique: true
create_table :organizations do |t| create_table :organizations do |t|
t.column :name, :string, limit: 100, null: false t.column :name, :string, limit: 100, null: false
t.column :shared, :boolean, null: false, default: true t.column :shared, :boolean, null: false, default: true
@ -126,7 +122,6 @@ class CreateBase < ActiveRecord::Migration
t.integer :organization_id t.integer :organization_id
end end
create_table :authorizations do |t| create_table :authorizations do |t|
t.string :provider, limit: 250, null: false t.string :provider, limit: 250, null: false
t.string :uid, 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, [:user_id]
add_index :authorizations, [:username] add_index :authorizations, [:username]
create_table :translations do |t| create_table :translations do |t|
t.column :locale, :string, limit: 10, null: false t.column :locale, :string, limit: 10, null: false
t.column :source, :string, limit: 255, 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, [:source]
add_index :translations, [:locale] add_index :translations, [:locale]
create_table :object_lookups do |t| create_table :object_lookups do |t|
t.column :name, :string, limit: 250, null: false t.column :name, :string, limit: 250, null: false
t.timestamps t.timestamps
@ -166,7 +159,6 @@ class CreateBase < ActiveRecord::Migration
end end
add_index :type_lookups, [:name], unique: true add_index :type_lookups, [:name], unique: true
create_table :tokens do |t| create_table :tokens do |t|
t.references :user, null: false t.references :user, null: false
t.string :name, limit: 100, 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, [:name, :action], unique: true
add_index :tokens, :created_at add_index :tokens, :created_at
create_table :packages do |t| create_table :packages do |t|
t.column :name, :string, limit: 250, null: false t.column :name, :string, limit: 250, null: false
t.column :version, :string, limit: 50, 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, [:user_id]
add_index :taskbars, [:client_id] add_index :taskbars, [:client_id]
create_table :tags do |t| create_table :tags do |t|
t.references :tag_item, null: false t.references :tag_item, null: false
t.references :tag_object, null: false t.references :tag_object, null: false
@ -232,7 +222,6 @@ class CreateBase < ActiveRecord::Migration
end end
add_index :tag_items, [:name], unique: true add_index :tag_items, [:name], unique: true
create_table :recent_views do |t| create_table :recent_views do |t|
t.references :recent_view_object, null: false t.references :recent_view_object, null: false
t.column :o_id, :integer, 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, [:created_at]
add_index :recent_views, [:recent_view_object_id] add_index :recent_views, [:recent_view_object_id]
create_table :activity_streams do |t| create_table :activity_streams do |t|
t.references :activity_stream_type, null: false t.references :activity_stream_type, null: false
t.references :activity_stream_object, null: false t.references :activity_stream_object, null: false
@ -306,7 +294,6 @@ class CreateBase < ActiveRecord::Migration
end end
add_index :history_attributes, [:name], unique: true add_index :history_attributes, [:name], unique: true
create_table :settings do |t| create_table :settings do |t|
t.column :title, :string, limit: 200, null: false t.column :title, :string, limit: 200, null: false
t.column :name, :string, limit: 200, null: false t.column :name, :string, limit: 200, null: false

View file

@ -620,7 +620,6 @@ class UpdateObjectManager2 < ActiveRecord::Migration
updated_by_id: 1, updated_by_id: 1,
) )
ObjectManager::Attribute.add( ObjectManager::Attribute.add(
object: 'Organization', object: 'Organization',
name: 'name', name: 'name',

View file

@ -154,8 +154,6 @@ Setting.create_if_not_exists(
frontend: true frontend: true
) )
Setting.create_if_not_exists( Setting.create_if_not_exists(
title: 'Storage Mechanism', title: 'Storage Mechanism',
name: 'storage', name: 'storage',
@ -912,7 +910,6 @@ Setting.create_if_not_exists(
frontend: true frontend: true
) )
Setting.create_if_not_exists( Setting.create_if_not_exists(
title: 'Enable Ticket View/Update', title: 'Enable Ticket View/Update',
name: 'customer_ticket_view', name: 'customer_ticket_view',
@ -1244,7 +1241,6 @@ Setting.create_if_not_exists(
frontend: false frontend: false
) )
email_address = EmailAddress.create_if_not_exists( email_address = EmailAddress.create_if_not_exists(
id: 1, id: 1,
realname: 'Zammad', realname: 'Zammad',

View file

@ -151,7 +151,6 @@ class String
chr_orig chr_orig
} }
# remove tailing empty spaces # remove tailing empty spaces
string.gsub!(/\s+\n$/, "\n") string.gsub!(/\s+\n$/, "\n")

View file

@ -201,7 +201,6 @@ module Import::OTRS
return return
end end
def self.ticket_diff() def self.ticket_diff()
url = 'public.pl?Action=Export;Type=TicketDiff;Limit=30' url = 'public.pl?Action=Export;Type=TicketDiff;Limit=30'
response = request( url ) response = request( url )

View file

@ -10,7 +10,6 @@ module Import::OTRS2
{ some json structure } { some json structure }
result = request_json( :Subaction => 'List' ) result = request_json( :Subaction => 'List' )
return return
@ -950,7 +949,6 @@ module Import::OTRS2
UserPw: :password, UserPw: :password,
}; };
records.each { |user| records.each { |user|
_set_valid(user) _set_valid(user)
@ -1177,12 +1175,10 @@ module Import::OTRS2
} }
end end
# sync settings # sync settings
def self.setting(records) def self.setting(records)
records.each { |setting| records.each { |setting|
# fqdn # fqdn
@ -1229,8 +1225,6 @@ module Import::OTRS2
} }
end end
# log # log
def self.log(message) def self.log(message)

View file

@ -244,7 +244,6 @@ return true if backend is configured
true true
end end
private private
def self.build_url( type = nil, o_id = nil ) def self.build_url( type = nil, o_id = nil )

View file

@ -8,7 +8,6 @@ class Sessions::Backend::Collections
@backends = self.backend @backends = self.backend
end end
def push def push
results = [] results = []
@backends.each {|backend| @backends.each {|backend|

View file

@ -43,7 +43,6 @@ class Sessions::Backend::TicketCreate
return if !ticket_create_attributes return if !ticket_create_attributes
data = { data = {
assets: ticket_create_attributes[:assets], assets: ticket_create_attributes[:assets],
form_meta: { form_meta: {
@ -52,7 +51,6 @@ class Sessions::Backend::TicketCreate
} }
} }
if !@client if !@client
return { return {
collection: 'ticket_create_attributes', collection: 'ticket_create_attributes',

View file

@ -122,7 +122,6 @@ put working hours matrix and timezone in function, returns UTC working hours mat
return ((end_time - start_time) / 60 ).round return ((end_time - start_time) / 60 ).round
end end
working_hours = self.working_hours(start_time, config, timezone) working_hours = self.working_hours(start_time, config, timezone)
week_day_map = { week_day_map = {
@ -145,7 +144,6 @@ put working hours matrix and timezone in function, returns UTC working hours mat
year = start_time.year year = start_time.year
hour = start_time.hour hour = start_time.hour
# check if it's vacation day # check if it's vacation day
if config if config
if config['holidays'] if config['holidays']

View file

@ -1,7 +1,6 @@
#!/usr/bin/env ruby #!/usr/bin/env ruby
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/ # Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
$LOAD_PATH << './lib' $LOAD_PATH << './lib'
require 'rubygems' require 'rubygems'
require 'daemons' require 'daemons'

View file

@ -1,7 +1,6 @@
#!/usr/bin/env ruby #!/usr/bin/env ruby
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/ # Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
$LOAD_PATH << './lib' $LOAD_PATH << './lib'
require 'rubygems' require 'rubygems'
require 'eventmachine' require 'eventmachine'

View file

@ -81,8 +81,6 @@ class AgentOrganizationProfileTest < TestCase
) )
tasks_close_all() tasks_close_all()
# work with two browser windows # work with two browser windows
message = 'comment 1 ' + rand(99_999_999_999_999_999).to_s message = 'comment 1 ' + rand(99_999_999_999_999_999).to_s

View file

@ -54,8 +54,6 @@ class AgentTicketActionLevel0Test < TestCase
) )
tasks_close_all( discard_changes: true ) tasks_close_all( discard_changes: true )
# test with two browser windows # test with two browser windows
random = 'text_II_module_test_' + rand(99_999_999).to_s random = 'text_II_module_test_' + rand(99_999_999).to_s
@ -145,7 +143,6 @@ class AgentTicketActionLevel0Test < TestCase
) )
sleep 2 sleep 2
set( set(
browser: browser2, browser: browser2,
css: '.active .newTicket input[name="customer_id_completion"]', css: '.active .newTicket input[name="customer_id_completion"]',

View file

@ -93,8 +93,6 @@ class AgentTicketActionLevel1Test < TestCase
# close task/cleanup # close task/cleanup
tasks_close_all() tasks_close_all()
# merge ticket with open tabs # merge ticket with open tabs
ticket3 = ticket_create( ticket3 = ticket_create(
data: { data: {

View file

@ -148,7 +148,6 @@ class AgentTicketActionsLevel3Test < TestCase
no_quote: true, no_quote: true,
) )
# reload instances, verify again # reload instances, verify again
reload( reload(
browser: browser1, browser: browser1,

View file

@ -109,7 +109,6 @@ class AgentTicketActionLevel5Test < TestCase
no_quote: true, no_quote: true,
) )
# select create channel # select create channel
click( click(
css: '.active [data-type="email-out"]', css: '.active [data-type="email-out"]',
@ -135,7 +134,6 @@ class AgentTicketActionLevel5Test < TestCase
no_quote: true, no_quote: true,
) )
# select group # select group
select( select(
css: '.active [name="group_id"]', css: '.active [name="group_id"]',

View file

@ -107,7 +107,6 @@ class AgentTicketActionLevel6Test < TestCase
value: 'test 6 - ticket 1-1', value: 'test 6 - ticket 1-1',
) )
# #
# ticket customer change checks # ticket customer change checks
# #
@ -201,7 +200,6 @@ class AgentTicketActionLevel6Test < TestCase
# form change/reset checks # form change/reset checks
# #
# some form reset checks # some form reset checks
end end
end end

View file

@ -77,8 +77,6 @@ class AgentUserProfileTest < TestCase
) )
tasks_close_all() tasks_close_all()
# work with two browser windows # work with two browser windows
message = 'comment 1 ' + rand(99_999_999_999_999_999).to_s message = 'comment 1 ' + rand(99_999_999_999_999_999).to_s

View file

@ -60,7 +60,6 @@ class SignupPasswordChangeAndResetTest < TestCase
) )
click( css: '.content .btn--primary' ) click( css: '.content .btn--primary' )
watch_for( watch_for(
css: 'body', css: 'body',
value: 'current password is wrong', value: 'current password is wrong',

View file

@ -787,7 +787,6 @@ wait untill text in selector disabppears
:timeout => '16', # in sec, default 16 :timeout => '16', # in sec, default 16
) )
=end =end
def watch_for_disappear(params = {}) def watch_for_disappear(params = {})
@ -1087,7 +1086,6 @@ wait untill text in selector disabppears
instance = params[:browser] || @browser instance = params[:browser] || @browser
data = params[:data] data = params[:data]
if data[:title] if data[:title]
#element = instance.find_elements( { :css => '.content.active .page-header .ticket-title-update' } )[0] #element = instance.find_elements( { :css => '.content.active .page-header .ticket-title-update' } )[0]
#element.clear #element.clear

View file

@ -260,7 +260,6 @@ class ElasticsearchTest < ActiveSupport::TestCase
assert(result[0], 'record 1') assert(result[0], 'record 1')
assert_equal(result[0].id, ticket1.id) assert_equal(result[0].id, ticket1.id)
# search for not indexed attachment # search for not indexed attachment
result = Ticket.search( result = Ticket.search(
current_user: agent, current_user: agent,
@ -276,7 +275,6 @@ class ElasticsearchTest < ActiveSupport::TestCase
) )
assert(!result[0], 'record 1') assert(!result[0], 'record 1')
# search for ticket with no permissions # search for ticket with no permissions
result = Ticket.search( result = Ticket.search(
current_user: agent, current_user: agent,
@ -286,7 +284,6 @@ class ElasticsearchTest < ActiveSupport::TestCase
assert(result.empty?, 'result should be empty') assert(result.empty?, 'result should be empty')
assert(!result[0], 'record 1') assert(!result[0], 'record 1')
# search as customer1 # search as customer1
result = Ticket.search( result = Ticket.search(
current_user: customer1, current_user: customer1,

View file

@ -15,7 +15,6 @@ class GeoIpTest < ActiveSupport::TestCase
assert_equal(nil, result['latitude']) assert_equal(nil, result['latitude'])
assert_equal(nil, result['longitude']) assert_equal(nil, result['longitude'])
result = GeoIp.location( '195.65.29.254' ) result = GeoIp.location( '195.65.29.254' )
assert(result) assert(result)
assert_equal('Switzerland', result['country_name']) assert_equal('Switzerland', result['country_name'])
@ -25,7 +24,6 @@ class GeoIpTest < ActiveSupport::TestCase
assert_equal(47.4299, result['latitude']) assert_equal(47.4299, result['latitude'])
assert_equal(8.465100000000007, result['longitude']) assert_equal(8.465100000000007, result['longitude'])
result = GeoIp.location( '134.109.140.74' ) result = GeoIp.location( '134.109.140.74' )
assert(result) assert(result)
assert_equal('Germany', result['country_name']) assert_equal('Germany', result['country_name'])
@ -35,7 +33,6 @@ class GeoIpTest < ActiveSupport::TestCase
assert_equal(50.83330000000001, result['latitude']) assert_equal(50.83330000000001, result['latitude'])
assert_equal(12.916699999999992, result['longitude']) assert_equal(12.916699999999992, result['longitude'])
result = GeoIp.location( '46.253.55.170' ) result = GeoIp.location( '46.253.55.170' )
assert(result) assert(result)
assert_equal('Germany', result['country_name']) assert_equal('Germany', result['country_name'])
@ -45,7 +42,6 @@ class GeoIpTest < ActiveSupport::TestCase
assert_equal(51.5, result['latitude']) assert_equal(51.5, result['latitude'])
assert_equal(12.0, result['longitude']) assert_equal(12.0, result['longitude'])
result = GeoIp.location( '169.229.216.200' ) result = GeoIp.location( '169.229.216.200' )
assert(result) assert(result)
assert_equal('United States', result['country_name']) assert_equal('United States', result['country_name'])

View file

@ -55,7 +55,6 @@ class OtrsImportTest < ActiveSupport::TestCase
assert_equal( 'agent-1@example.com', user1.email ) assert_equal( 'agent-1@example.com', user1.email )
assert_equal( true, user1.active ) assert_equal( true, user1.active )
assert( user1.roles.include?( role_agent ) ) assert( user1.roles.include?( role_agent ) )
assert( !user1.roles.include?( role_admin ) ) assert( !user1.roles.include?( role_admin ) )
assert( !user1.roles.include?( role_customer ) ) 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_dasa ) )
assert( user1.groups.include?( group_raw ) ) assert( user1.groups.include?( group_raw ) )
user2 = User.find(3) user2 = User.find(3)
assert_equal( 'agent-2 firstname äöüß', user2.firstname ) assert_equal( 'agent-2 firstname äöüß', user2.firstname )
assert_equal( 'agent-2 lastname äöüß', user2.lastname ) assert_equal( 'agent-2 lastname äöüß', user2.lastname )

View file

@ -103,8 +103,6 @@ class UserAgentTest < ActiveSupport::TestCase
assert_equal('404', result.code) assert_equal('404', result.code)
assert_equal(NilClass, result.body.class) assert_equal(NilClass, result.body.class)
# with http basic auth # with http basic auth
# get / 200 # get / 200
@ -208,7 +206,6 @@ class UserAgentTest < ActiveSupport::TestCase
assert_equal('401', result.code) assert_equal('401', result.code)
assert_equal(NilClass, result.body.class) assert_equal(NilClass, result.body.class)
# delete / 200 # delete / 200
result = UserAgent.delete( result = UserAgent.delete(
"#{host}/test_basic_auth/delete/1", "#{host}/test_basic_auth/delete/1",
@ -253,7 +250,6 @@ class UserAgentTest < ActiveSupport::TestCase
assert(result.body =~ /"abc"/) assert(result.body =~ /"abc"/)
assert(result.body =~ /"text\/plain"/) assert(result.body =~ /"text\/plain"/)
# get / 301 # get / 301
result = UserAgent.request( result = UserAgent.request(
"#{host}/test_basic_auth/redirect", "#{host}/test_basic_auth/redirect",
@ -270,7 +266,6 @@ class UserAgentTest < ActiveSupport::TestCase
assert(result.body =~ /"abc"/) assert(result.body =~ /"abc"/)
assert(result.body =~ /"text\/plain"/) assert(result.body =~ /"text\/plain"/)
# get / 401 # get / 401
result = UserAgent.request( result = UserAgent.request(
"#{host}/test_basic_auth/redirect", "#{host}/test_basic_auth/redirect",
@ -361,7 +356,6 @@ class UserAgentTest < ActiveSupport::TestCase
end end
# check # check
test 'check not existing' do test 'check not existing' do
@ -384,7 +378,6 @@ class UserAgentTest < ActiveSupport::TestCase
assert_equal(NilClass, result.body.class) assert_equal(NilClass, result.body.class)
end end
# check # check
test 'check timeout' do test 'check timeout' do

View file

@ -75,7 +75,6 @@ class AaaStringTest < ActiveSupport::TestCase
result = "test col \ntest 4711" result = "test col \ntest 4711"
assert_equal( result, html.html2text ) assert_equal( result, html.html2text )
html = "<!-- some comment --> html = "<!-- some comment -->
<div> <div>
test<br><br><br>\n<br>\n<br>\n test<br><br><br>\n<br>\n<br>\n
@ -104,7 +103,6 @@ you
-----&' -----&'
assert_equal( should, html.html2text ) assert_equal( should, html.html2text )
html = ' <ul><li>#1</li><li>#2</li></ul>' html = ' <ul><li>#1</li><li>#2</li></ul>'
should = '* #1 should = '* #1
* #2' * #2'

View file

@ -88,7 +88,6 @@ class ActivityStreamTest < ActiveSupport::TestCase
ticket = nil ticket = nil
article = nil article = nil
ticket = Ticket.create( test[:create][:ticket] ) ticket = Ticket.create( test[:create][:ticket] )
test[:check][0][:o_id] = ticket.id test[:check][0][:o_id] = ticket.id
test[:check][2][:o_id] = ticket.id test[:check][2][:o_id] = ticket.id
@ -221,7 +220,6 @@ class ActivityStreamTest < ActiveSupport::TestCase
} }
end end
test 'user with update check false' do test 'user with update check false' do
tests = [ tests = [

View file

@ -28,7 +28,6 @@ class DbAutoIncrementTest < ActiveSupport::TestCase
assert_equal( Ticket::StateType.to_s, state_type.class.to_s ) assert_equal( Ticket::StateType.to_s, state_type.class.to_s )
assert_equal( 'unit test 1 _ should be updated', state_type.name ) 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 ) 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 state = Ticket::State.where( name: 'unit test 1' ).first
assert_equal( Ticket::State.to_s, state.class.to_s ) 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( Ticket::State.to_s, state.class.to_s )
assert_equal( 'unit test 1 _ should be updated', state.name ) assert_equal( 'unit test 1 _ should be updated', state.name )
Setting.set('system_init_done', setting_backup) Setting.set('system_init_done', setting_backup)
end end

View file

@ -13,7 +13,6 @@ class EmailBuildTest < ActiveSupport::TestCase
assert( result =~ /font-family/, 'test 1') assert( result =~ /font-family/, 'test 1')
assert( result =~ /<b>test<\/b>/, 'test 1') assert( result =~ /<b>test<\/b>/, 'test 1')
html = 'invalid <!DOCTYPE html><html><b>test</b></html>' html = 'invalid <!DOCTYPE html><html><b>test</b></html>'
result = Channel::EmailBuild.html_complete_check( html ) result = Channel::EmailBuild.html_complete_check( html )

View file

@ -353,7 +353,6 @@ class HistoryTest < ActiveSupport::TestCase
} }
end end
def history_check( history_list, history_check ) def history_check( history_list, history_check )
# puts history_list.inspect # puts history_list.inspect
history_check.each { |check_item| history_check.each { |check_item|

View file

@ -12,7 +12,6 @@ class ObjectTypeLookupTest < ActiveSupport::TestCase
assert( object_lookup_name, 'first by_id' ) assert( object_lookup_name, 'first by_id' )
assert_equal( object_lookup_name, 'SomeObject' ) assert_equal( object_lookup_name, 'SomeObject' )
object_lookup_id2 = ObjectLookup.by_name( 'Some_Object' ) object_lookup_id2 = ObjectLookup.by_name( 'Some_Object' )
assert( object_lookup_id2, '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( object_lookup_name2, 'by_id - Some_Object' )
assert_equal( object_lookup_name2, 'Some_Object' ) assert_equal( object_lookup_name2, 'Some_Object' )
object_lookup_id3 = ObjectLookup.by_name( 'SomeObject' ) object_lookup_id3 = ObjectLookup.by_name( 'SomeObject' )
assert( object_lookup_id3, 'by_name 2 - 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( type_lookup_name, 'first by_id' )
assert_equal( type_lookup_name, 'SomeType' ) assert_equal( type_lookup_name, 'SomeType' )
type_lookup_id2 = TypeLookup.by_name( 'Some_Type' ) type_lookup_id2 = TypeLookup.by_name( 'Some_Type' )
assert( type_lookup_id2, '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( type_lookup_name2, 'by_id - Some_Type' )
assert_equal( type_lookup_name2, 'Some_Type' ) assert_equal( type_lookup_name2, 'Some_Type' )
type_lookup_id3 = TypeLookup.by_name( 'SomeType' ) type_lookup_id3 = TypeLookup.by_name( 'SomeType' )
assert( type_lookup_id3, 'by_name 2 - SomeType' ) assert( type_lookup_id3, 'by_name 2 - SomeType' )

View file

@ -28,7 +28,6 @@ class RecentViewTest < ActiveSupport::TestCase
user1 = User.find(2) user1 = User.find(2)
RecentView.user_log_destroy(user1) RecentView.user_log_destroy(user1)
RecentView.log( ticket1.class.to_s, ticket1.id, user1 ) RecentView.log( ticket1.class.to_s, ticket1.id, user1 )
sleep 1 sleep 1
RecentView.log( ticket2.class.to_s, ticket2.id, user1 ) RecentView.log( ticket2.class.to_s, ticket2.id, user1 )
@ -68,7 +67,6 @@ class RecentViewTest < ActiveSupport::TestCase
list = RecentView.list( user ) list = RecentView.list( user )
assert( !list[0], 'check if recent view list is empty' ) assert( !list[0], 'check if recent view list is empty' )
# log entry of not existing record # log entry of not existing record
RecentView.user_log_destroy(user) RecentView.user_log_destroy(user)
RecentView.log( 'User', 99_999_999, user ) RecentView.log( 'User', 99_999_999, user )
@ -77,7 +75,6 @@ class RecentViewTest < ActiveSupport::TestCase
list = RecentView.list( user ) list = RecentView.list( user )
assert( !list[0], 'check if recent view list is empty' ) assert( !list[0], 'check if recent view list is empty' )
# log entry of not existing model with permission check # log entry of not existing model with permission check
RecentView.user_log_destroy(user) RecentView.user_log_destroy(user)
RecentView.log( 'Overview', 99_999_999, user ) RecentView.log( 'Overview', 99_999_999, user )
@ -139,7 +136,6 @@ class RecentViewTest < ActiveSupport::TestCase
list = RecentView.list( agent ) list = RecentView.list( agent )
assert( !list[0], 'check if recent view list is empty' ) assert( !list[0], 'check if recent view list is empty' )
# access for customer via customer id # access for customer via customer id
ticket1 = Ticket.create( ticket1 = Ticket.create(
title: 'RecentViewTest 1 some title äöüß', title: 'RecentViewTest 1 some title äöüß',
@ -162,7 +158,6 @@ class RecentViewTest < ActiveSupport::TestCase
assert( list[0]['object'], 'Ticket' ) assert( list[0]['object'], 'Ticket' )
assert( !list[1], 'check if recent view list is empty' ) assert( !list[1], 'check if recent view list is empty' )
# log entry # log entry
organization = Organization.find(1) organization = Organization.find(1)
RecentView.user_log_destroy(customer) RecentView.user_log_destroy(customer)
@ -172,7 +167,6 @@ class RecentViewTest < ActiveSupport::TestCase
list = RecentView.list( customer ) list = RecentView.list( customer )
assert( !list[0], 'check if recent view list is empty' ) assert( !list[0], 'check if recent view list is empty' )
# log entry # log entry
organization = Organization.find(1) organization = Organization.find(1)
RecentView.user_log_destroy(agent) RecentView.user_log_destroy(agent)

View file

@ -147,7 +147,6 @@ class RestTest < ActiveSupport::TestCase
assert_equal( request[:response].code, '401' ) assert_equal( request[:response].code, '401' )
assert_equal( request[:data].class, NilClass) assert_equal( request[:data].class, NilClass)
# /organizations # /organizations
# index # index
@ -197,7 +196,6 @@ class RestTest < ActiveSupport::TestCase
assert_equal( request[:response].code, '401' ) assert_equal( request[:response].code, '401' )
assert_equal( request[:data].class, NilClass) assert_equal( request[:data].class, NilClass)
# packages # packages
request = get( 'rest-admin@example.com', 'adminpw', '/api/v1/packages' ) request = get( 'rest-admin@example.com', 'adminpw', '/api/v1/packages' )
assert_equal( request[:response].code, '200' ) assert_equal( request[:response].code, '200' )

View file

@ -115,7 +115,6 @@ class SessionEnhancedTest < ActiveSupport::TestCase
assert_equal( 'ws:login', messages[0]['event'], 'messages 1') assert_equal( 'ws:login', messages[0]['event'], 'messages 1')
assert_equal( true, messages[0]['data']['success'], 'messages 1') assert_equal( true, messages[0]['data']['success'], 'messages 1')
# broadcast to all clients # broadcast to all clients
Sessions.broadcast( { msg: 'ooo123123123123123123'} ) Sessions.broadcast( { msg: 'ooo123123123123123123'} )
messages = Sessions.queue(client_id1) messages = Sessions.queue(client_id1)

View file

@ -220,8 +220,6 @@ class TicketNotificationTest < ActiveSupport::TestCase
assert_equal( 1, notification_check(ticket2, agent1), ticket2.id ) assert_equal( 1, notification_check(ticket2, agent1), ticket2.id )
assert_equal( 0, notification_check(ticket2, agent2), ticket2.id ) assert_equal( 0, notification_check(ticket2, agent2), ticket2.id )
# create ticket with agent2 and agent1 as owner # create ticket with agent2 and agent1 as owner
ticket3 = Ticket.create( ticket3 = Ticket.create(
title: 'some notification test 3', title: 'some notification test 3',
@ -287,7 +285,6 @@ class TicketNotificationTest < ActiveSupport::TestCase
assert_equal( 2, notification_check(ticket3, agent1), ticket3.id ) assert_equal( 2, notification_check(ticket3, agent1), ticket3.id )
assert_equal( 0, notification_check(ticket3, agent2), ticket3.id ) assert_equal( 0, notification_check(ticket3, agent2), ticket3.id )
# update article / not notification should be sent # update article / not notification should be sent
article_inbound.internal = true article_inbound.internal = true
article_inbound.save article_inbound.save
@ -301,7 +298,6 @@ class TicketNotificationTest < ActiveSupport::TestCase
assert_equal( 2, notification_check(ticket3, agent1), ticket3.id ) assert_equal( 2, notification_check(ticket3, agent1), ticket3.id )
assert_equal( 0, notification_check(ticket3, agent2), ticket3.id ) assert_equal( 0, notification_check(ticket3, agent2), ticket3.id )
delete = ticket1.destroy delete = ticket1.destroy
assert( delete, 'ticket1 destroy' ) assert( delete, 'ticket1 destroy' )
@ -373,7 +369,6 @@ class TicketNotificationTest < ActiveSupport::TestCase
end end
test 'ticket notification template' do test 'ticket notification template' do
# create ticket in group # create ticket in group
@ -536,8 +531,6 @@ class TicketNotificationTest < ActiveSupport::TestCase
template = bg.template_update(agent2, ticket1, article, human_changes) template = bg.template_update(agent2, ticket1, article, human_changes)
puts "t2 #{template.inspect}" puts "t2 #{template.inspect}"
end end
def notification_check(ticket, recipient) def notification_check(ticket, recipient)

View file

@ -286,7 +286,6 @@ class TicketSlaTest < ActiveSupport::TestCase
delete = ticket.destroy delete = ticket.destroy
assert( delete, 'ticket destroy' ) assert( delete, 'ticket destroy' )
ticket = Ticket.create( ticket = Ticket.create(
title: 'some title äöüß', title: 'some title äöüß',
group: Group.lookup( name: 'Users'), group: Group.lookup( name: 'Users'),
@ -591,7 +590,6 @@ class TicketSlaTest < ActiveSupport::TestCase
) )
assert( ticket, 'ticket created' ) assert( ticket, 'ticket created' )
# set ticket from 11:30 to closed # set ticket from 11:30 to closed
History.add( History.add(
history_type: 'updated', history_type: 'updated',
@ -642,7 +640,6 @@ class TicketSlaTest < ActiveSupport::TestCase
delete = ticket.destroy delete = ticket.destroy
assert( delete, 'ticket destroy' ) assert( delete, 'ticket destroy' )
# test Ticket created in state pending, changed state to openen, back to pending and closed # test Ticket created in state pending, changed state to openen, back to pending and closed
ticket = Ticket.create( ticket = Ticket.create(
title: 'some title äöüß3', title: 'some title äöüß3',

View file

@ -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_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' ) assert( ticket.close_time, 'ticket.close_time verify - state update' )
# set pending time # set pending time
ticket.state_id = Ticket::State.where(name: 'pending reminder').first.id ticket.state_id = Ticket::State.where(name: 'pending reminder').first.id
ticket.pending_time = Time.parse('1977-10-27 22:00:00 +0000') 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.state.name, 'pending reminder', 'state verify' )
assert_equal( ticket.pending_time, Time.parse('1977-10-27 22:00:00 +0000'), 'pending_time 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 # reset pending state, should also reset pending time
ticket.state_id = Ticket::State.where(name: 'closed').first.id ticket.state_id = Ticket::State.where(name: 'closed').first.id
ticket.save ticket.save
@ -119,12 +117,10 @@ class TicketTest < ActiveSupport::TestCase
assert_equal( ticket.state.name, 'closed', 'state verify' ) assert_equal( ticket.state.name, 'closed', 'state verify' )
assert_equal( ticket.pending_time, nil ) assert_equal( ticket.pending_time, nil )
delete = ticket.destroy delete = ticket.destroy
assert( delete, 'ticket destroy' ) assert( delete, 'ticket destroy' )
end end
test 'ticket latest change' do test 'ticket latest change' do
ticket1 = Ticket.create( ticket1 = Ticket.create(
title: 'latest change 1', title: 'latest change 1',

View file

@ -335,7 +335,6 @@ class WorkingTimeTest < ActiveSupport::TestCase
}, },
}, },
# test 6 # test 6
{ {
start: '2012-12-17 08:00:00', start: '2012-12-17 08:00:00',