diff --git a/app/controllers/ical_tickets_controller.rb b/app/controllers/ical_tickets_controller.rb index d556aefd7..e8a93ba6d 100644 --- a/app/controllers/ical_tickets_controller.rb +++ b/app/controllers/ical_tickets_controller.rb @@ -139,7 +139,6 @@ class IcalTicketsController < ApplicationController events_data end - def escalation_events_data_get condition = [ diff --git a/app/controllers/import_otrs_controller.rb b/app/controllers/import_otrs_controller.rb index 3979d8b85..ae38a2395 100644 --- a/app/controllers/import_otrs_controller.rb +++ b/app/controllers/import_otrs_controller.rb @@ -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', diff --git a/app/controllers/long_polling_controller.rb b/app/controllers/long_polling_controller.rb index 81f96efc0..e6ab7838b 100644 --- a/app/controllers/long_polling_controller.rb +++ b/app/controllers/long_polling_controller.rb @@ -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] diff --git a/app/controllers/object_manager_attributes_controller.rb b/app/controllers/object_manager_attributes_controller.rb index 5024303d0..60a372b64 100644 --- a/app/controllers/object_manager_attributes_controller.rb +++ b/app/controllers/object_manager_attributes_controller.rb @@ -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) diff --git a/app/controllers/tickets_controller.rb b/app/controllers/tickets_controller.rb index 981c32408..f92ce43cd 100644 --- a/app/controllers/tickets_controller.rb +++ b/app/controllers/tickets_controller.rb @@ -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| diff --git a/app/models/application_model.rb b/app/models/application_model.rb index 1242dec17..952cd2d1f 100644 --- a/app/models/application_model.rb +++ b/app/models/application_model.rb @@ -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 diff --git a/app/models/channel/facebook.rb b/app/models/channel/facebook.rb index 746207dc6..e1f953823 100644 --- a/app/models/channel/facebook.rb +++ b/app/models/channel/facebook.rb @@ -7,12 +7,10 @@ class Channel::Facebook # def fetch(:oauth_token, :oauth_token_secret) def fetch - end def disconnect - end def send diff --git a/app/models/history.rb b/app/models/history.rb index 55e2c05a3..1b24f60f2 100644 --- a/app/models/history.rb +++ b/app/models/history.rb @@ -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 ) diff --git a/app/models/object_manager.rb b/app/models/object_manager.rb index c4be41e12..711666bb5 100644 --- a/app/models/object_manager.rb +++ b/app/models/object_manager.rb @@ -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 diff --git a/app/models/observer/ticket/notification.rb b/app/models/observer/ticket/notification.rb index 749ef63cb..8d297ee1d 100644 --- a/app/models/observer/ticket/notification.rb +++ b/app/models/observer/ticket/notification.rb @@ -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 diff --git a/app/models/observer/user/geo.rb b/app/models/observer/user/geo.rb index 875fbd872..15d874b08 100644 --- a/app/models/observer/user/geo.rb +++ b/app/models/observer/user/geo.rb @@ -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 = '' diff --git a/app/models/ticket/escalation.rb b/app/models/ticket/escalation.rb index 80a37bfc0..132b03e96 100644 --- a/app/models/ticket/escalation.rb +++ b/app/models/ticket/escalation.rb @@ -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 diff --git a/app/models/ticket/screen_options.rb b/app/models/ticket/screen_options.rb index 33691051d..9a3db1b71 100644 --- a/app/models/ticket/screen_options.rb +++ b/app/models/ticket/screen_options.rb @@ -81,7 +81,6 @@ returns } filter[:priority_id] = priority_ids - type_ids = [] if params[:ticket] types = ['note', 'phone'] diff --git a/app/models/ticket/search.rb b/app/models/ticket/search.rb index 41ced1f6e..bb5ccf73d 100644 --- a/app/models/ticket/search.rb +++ b/app/models/ticket/search.rb @@ -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) diff --git a/config/application.rb b/config/application.rb index dbf164ec3..807c61867 100644 --- a/config/application.rb +++ b/config/application.rb @@ -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 diff --git a/db/migrate/20120101000001_create_base.rb b/db/migrate/20120101000001_create_base.rb index 9294b2de6..2f8d2db7e 100644 --- a/db/migrate/20120101000001_create_base.rb +++ b/db/migrate/20120101000001_create_base.rb @@ -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 diff --git a/db/migrate/20141217000001_update_object_manager2.rb b/db/migrate/20141217000001_update_object_manager2.rb index 7cda354ca..5aff4c85d 100644 --- a/db/migrate/20141217000001_update_object_manager2.rb +++ b/db/migrate/20141217000001_update_object_manager2.rb @@ -620,7 +620,6 @@ class UpdateObjectManager2 < ActiveRecord::Migration updated_by_id: 1, ) - ObjectManager::Attribute.add( object: 'Organization', name: 'name', diff --git a/db/seeds.rb b/db/seeds.rb index e4e22b95b..42fbc22f9 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -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', diff --git a/lib/core_ext/string.rb b/lib/core_ext/string.rb index aabb5b2a2..7dae03766 100644 --- a/lib/core_ext/string.rb +++ b/lib/core_ext/string.rb @@ -151,7 +151,6 @@ class String chr_orig } - # remove tailing empty spaces string.gsub!(/\s+\n$/, "\n") diff --git a/lib/import/otrs.rb b/lib/import/otrs.rb index 3824d098a..b92bca452 100644 --- a/lib/import/otrs.rb +++ b/lib/import/otrs.rb @@ -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 ) diff --git a/lib/import/otrs2.rb b/lib/import/otrs2.rb index 644183e8f..c5b54e1b8 100644 --- a/lib/import/otrs2.rb +++ b/lib/import/otrs2.rb @@ -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) diff --git a/lib/search_index_backend.rb b/lib/search_index_backend.rb index 174c4859f..20be18483 100644 --- a/lib/search_index_backend.rb +++ b/lib/search_index_backend.rb @@ -244,7 +244,6 @@ return true if backend is configured true end - private def self.build_url( type = nil, o_id = nil ) diff --git a/lib/sessions/backend/collections.rb b/lib/sessions/backend/collections.rb index 4c8d65c4a..34b0111e2 100644 --- a/lib/sessions/backend/collections.rb +++ b/lib/sessions/backend/collections.rb @@ -8,7 +8,6 @@ class Sessions::Backend::Collections @backends = self.backend end - def push results = [] @backends.each {|backend| diff --git a/lib/sessions/backend/ticket_create.rb b/lib/sessions/backend/ticket_create.rb index 387ff7731..039059417 100644 --- a/lib/sessions/backend/ticket_create.rb +++ b/lib/sessions/backend/ticket_create.rb @@ -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', diff --git a/lib/time_calculation.rb b/lib/time_calculation.rb index 222bebfe3..79bcbc3ab 100644 --- a/lib/time_calculation.rb +++ b/lib/time_calculation.rb @@ -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'] diff --git a/script/scheduler.rb b/script/scheduler.rb index d8189dcb0..dc3644b43 100755 --- a/script/scheduler.rb +++ b/script/scheduler.rb @@ -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' diff --git a/script/websocket-server.rb b/script/websocket-server.rb index 31d1d18f1..aca2645b2 100755 --- a/script/websocket-server.rb +++ b/script/websocket-server.rb @@ -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' diff --git a/test/browser/agent_organization_profile_test.rb b/test/browser/agent_organization_profile_test.rb index 05549911a..6ba8d3e0e 100644 --- a/test/browser/agent_organization_profile_test.rb +++ b/test/browser/agent_organization_profile_test.rb @@ -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 diff --git a/test/browser/agent_ticket_actions_level0_test.rb b/test/browser/agent_ticket_actions_level0_test.rb index ba5a602c0..b901ae59b 100644 --- a/test/browser/agent_ticket_actions_level0_test.rb +++ b/test/browser/agent_ticket_actions_level0_test.rb @@ -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"]', diff --git a/test/browser/agent_ticket_actions_level1_test.rb b/test/browser/agent_ticket_actions_level1_test.rb index 5bcf39a68..4c6d9d4e2 100644 --- a/test/browser/agent_ticket_actions_level1_test.rb +++ b/test/browser/agent_ticket_actions_level1_test.rb @@ -93,8 +93,6 @@ class AgentTicketActionLevel1Test < TestCase # close task/cleanup tasks_close_all() - - # merge ticket with open tabs ticket3 = ticket_create( data: { diff --git a/test/browser/agent_ticket_actions_level3_test.rb b/test/browser/agent_ticket_actions_level3_test.rb index 95b6a4a39..57c289b1c 100644 --- a/test/browser/agent_ticket_actions_level3_test.rb +++ b/test/browser/agent_ticket_actions_level3_test.rb @@ -148,7 +148,6 @@ class AgentTicketActionsLevel3Test < TestCase no_quote: true, ) - # reload instances, verify again reload( browser: browser1, diff --git a/test/browser/agent_ticket_actions_level5_test.rb b/test/browser/agent_ticket_actions_level5_test.rb index f24b12a91..4057ed97c 100644 --- a/test/browser/agent_ticket_actions_level5_test.rb +++ b/test/browser/agent_ticket_actions_level5_test.rb @@ -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"]', diff --git a/test/browser/agent_ticket_actions_level6_test.rb b/test/browser/agent_ticket_actions_level6_test.rb index bba17b76a..b7798a121 100644 --- a/test/browser/agent_ticket_actions_level6_test.rb +++ b/test/browser/agent_ticket_actions_level6_test.rb @@ -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 diff --git a/test/browser/agent_user_profile_test.rb b/test/browser/agent_user_profile_test.rb index 1b1782c4c..df9d3955d 100644 --- a/test/browser/agent_user_profile_test.rb +++ b/test/browser/agent_user_profile_test.rb @@ -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 diff --git a/test/browser/signup_password_change_and_reset_test.rb b/test/browser/signup_password_change_and_reset_test.rb index ef6907672..4827ac1bb 100644 --- a/test/browser/signup_password_change_and_reset_test.rb +++ b/test/browser/signup_password_change_and_reset_test.rb @@ -60,7 +60,6 @@ class SignupPasswordChangeAndResetTest < TestCase ) click( css: '.content .btn--primary' ) - watch_for( css: 'body', value: 'current password is wrong', diff --git a/test/browser_test_helper.rb b/test/browser_test_helper.rb index 730334ae3..c9126d3f8 100644 --- a/test/browser_test_helper.rb +++ b/test/browser_test_helper.rb @@ -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 diff --git a/test/integration/elasticsearch_test.rb b/test/integration/elasticsearch_test.rb index dfacaf92a..dfc321b8d 100644 --- a/test/integration/elasticsearch_test.rb +++ b/test/integration/elasticsearch_test.rb @@ -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, diff --git a/test/integration/geo_ip_test.rb b/test/integration/geo_ip_test.rb index 9404f31b7..07fdbbd00 100644 --- a/test/integration/geo_ip_test.rb +++ b/test/integration/geo_ip_test.rb @@ -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']) diff --git a/test/integration/otrs_import_test.rb b/test/integration/otrs_import_test.rb index 6fff031ca..3c738030a 100644 --- a/test/integration/otrs_import_test.rb +++ b/test/integration/otrs_import_test.rb @@ -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 ) diff --git a/test/integration/user_agent_test.rb b/test/integration/user_agent_test.rb index 02aba36c6..68cc6c7ce 100644 --- a/test/integration/user_agent_test.rb +++ b/test/integration/user_agent_test.rb @@ -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 diff --git a/test/unit/aaa_string_test.rb b/test/unit/aaa_string_test.rb index 987831d9c..b9f8b3ca9 100644 --- a/test/unit/aaa_string_test.rb +++ b/test/unit/aaa_string_test.rb @@ -75,7 +75,6 @@ class AaaStringTest < ActiveSupport::TestCase result = "test col \ntest 4711" assert_equal( result, html.html2text ) - html = "
test


\n
\n
\n @@ -104,7 +103,6 @@ you -----&' assert_equal( should, html.html2text ) - html = ' ' should = '* #1 * #2' diff --git a/test/unit/activity_stream_test.rb b/test/unit/activity_stream_test.rb index 510977b62..a2f278bca 100644 --- a/test/unit/activity_stream_test.rb +++ b/test/unit/activity_stream_test.rb @@ -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 = [ diff --git a/test/unit/db_auto_increment_test.rb b/test/unit/db_auto_increment_test.rb index 5e33d4d62..4872b33ae 100644 --- a/test/unit/db_auto_increment_test.rb +++ b/test/unit/db_auto_increment_test.rb @@ -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 diff --git a/test/unit/email_build_test.rb b/test/unit/email_build_test.rb index 772d571ec..b8efa307c 100644 --- a/test/unit/email_build_test.rb +++ b/test/unit/email_build_test.rb @@ -13,7 +13,6 @@ class EmailBuildTest < ActiveSupport::TestCase assert( result =~ /font-family/, 'test 1') assert( result =~ /test<\/b>/, 'test 1') - html = 'invalid test' result = Channel::EmailBuild.html_complete_check( html ) diff --git a/test/unit/history_test.rb b/test/unit/history_test.rb index 09b54c7a6..6426c2fc0 100644 --- a/test/unit/history_test.rb +++ b/test/unit/history_test.rb @@ -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| diff --git a/test/unit/object_type_lookup_test.rb b/test/unit/object_type_lookup_test.rb index c54ae65be..d4643d471 100644 --- a/test/unit/object_type_lookup_test.rb +++ b/test/unit/object_type_lookup_test.rb @@ -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' ) diff --git a/test/unit/recent_view_test.rb b/test/unit/recent_view_test.rb index 4bdaebdeb..4576b1507 100644 --- a/test/unit/recent_view_test.rb +++ b/test/unit/recent_view_test.rb @@ -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) diff --git a/test/unit/rest_test.rb b/test/unit/rest_test.rb index 1e2844ad4..5812414a2 100644 --- a/test/unit/rest_test.rb +++ b/test/unit/rest_test.rb @@ -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' ) diff --git a/test/unit/session_enhanced_test.rb b/test/unit/session_enhanced_test.rb index f5b29c03f..6c40120c7 100644 --- a/test/unit/session_enhanced_test.rb +++ b/test/unit/session_enhanced_test.rb @@ -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) diff --git a/test/unit/ticket_notification_test.rb b/test/unit/ticket_notification_test.rb index 455f29e10..75505aa6b 100644 --- a/test/unit/ticket_notification_test.rb +++ b/test/unit/ticket_notification_test.rb @@ -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) diff --git a/test/unit/ticket_sla_test.rb b/test/unit/ticket_sla_test.rb index 4c6408d61..3bacb6ba8 100644 --- a/test/unit/ticket_sla_test.rb +++ b/test/unit/ticket_sla_test.rb @@ -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', diff --git a/test/unit/ticket_test.rb b/test/unit/ticket_test.rb index fc1207284..fc8d303d3 100644 --- a/test/unit/ticket_test.rb +++ b/test/unit/ticket_test.rb @@ -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',