diff --git a/app/controllers/getting_started_controller.rb b/app/controllers/getting_started_controller.rb
index 95a05ff38..ab63470b6 100644
--- a/app/controllers/getting_started_controller.rb
+++ b/app/controllers/getting_started_controller.rb
@@ -609,7 +609,7 @@ curl http://localhost/api/v1/getting_started -v -u #{login}:#{password}
# send verify email to inbox
if !params[:subject]
- subject = '#' + rand(99999999999).to_s
+ subject = '#' + rand(99_999_999_999).to_s
else
subject = params[:subject]
end
diff --git a/app/controllers/long_polling_controller.rb b/app/controllers/long_polling_controller.rb
index 5381582ad..bb8947c14 100644
--- a/app/controllers/long_polling_controller.rb
+++ b/app/controllers/long_polling_controller.rb
@@ -149,7 +149,7 @@ class LongPollingController < ApplicationController
private
def client_id_gen
- rand(9999999999).to_s
+ rand(9_999_999_999).to_s
end
def client_id_verify
diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb
index 9e15657ad..5ccb54120 100644
--- a/app/controllers/sessions_controller.rb
+++ b/app/controllers/sessions_controller.rb
@@ -45,7 +45,7 @@ class SessionsController < ApplicationController
# check logon session
logon_session_key = nil
if params['logon_session']
- logon_session_key = Digest::MD5.hexdigest( rand(999999).to_s + Time.new.to_s )
+ logon_session_key = Digest::MD5.hexdigest( rand(999_999).to_s + Time.new.to_s )
# session = ActiveRecord::SessionStore::Session.create(
# :session_id => logon_session_key,
# :data => {
diff --git a/app/models/observer/ticket/article/fillup_from_email.rb b/app/models/observer/ticket/article/fillup_from_email.rb
index 490aeca7c..8455824df 100644
--- a/app/models/observer/ticket/article/fillup_from_email.rb
+++ b/app/models/observer/ticket/article/fillup_from_email.rb
@@ -28,7 +28,7 @@ class Observer::Ticket::Article::FillupFromEmail < ActiveRecord::Observer
# generate message id
fqdn = Setting.get('fqdn')
- record.message_id = '<' + DateTime.current.to_s(:number) + '.' + record.ticket_id.to_s + '.' + rand(999999).to_s() + '@' + fqdn + '>'
+ record.message_id = '<' + DateTime.current.to_s(:number) + '.' + record.ticket_id.to_s + '.' + rand(999_999).to_s() + '@' + fqdn + '>'
# set sender
email_address = ticket.group.email_address
diff --git a/app/models/store.rb b/app/models/store.rb
index 7ce210d51..d72f49e8c 100644
--- a/app/models/store.rb
+++ b/app/models/store.rb
@@ -57,8 +57,8 @@ returns
get attachment of object
list = Store.list(
- :object => 'Ticket::Article',
- :o_id => 4711,
+ :object => 'Ticket::Article',
+ :o_id => 4711,
)
returns
@@ -66,9 +66,9 @@ returns
result = [store1, store2]
store1 = {
- :size => 94123,
- :filename => 'image.png',
- :preferences => {
+ :size => 94123,
+ :filename => 'image.png',
+ :preferences => {
:content_type => 'image/png',
:content_id => 234,
}
@@ -90,8 +90,8 @@ returns
remove attachments of object from storage
result = Store.remove(
- :object => 'Ticket::Article',
- :o_id => 4711,
+ :object => 'Ticket::Article',
+ :o_id => 4711,
)
returns
diff --git a/config/environments/development.rb b/config/environments/development.rb
index e1f3b84eb..aff97c145 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -34,7 +34,7 @@ Zammad::Application.configure do
config.middleware.use(Rack::LiveReload,
:min_delay => 500, # default 1000
:max_delay => 10_000, # default 60_000
- :live_reload_port => 35738,
+ :live_reload_port => 35_738,
:source => :vendored
)
diff --git a/db/migrate/20120101000020_create_network.rb b/db/migrate/20120101000020_create_network.rb
index d963d1661..5f64426bc 100644
--- a/db/migrate/20120101000020_create_network.rb
+++ b/db/migrate/20120101000020_create_network.rb
@@ -51,7 +51,7 @@ class CreateNetwork < ActiveRecord::Migration
create_table :network_items do |t|
t.references :network_category, :null => false
t.column :title, :string, :limit => 200, :null => false
- t.column :body, :string, :limit => 20000, :null => false
+ t.column :body, :string, :limit => 20_000, :null => false
t.column :updated_by_id, :integer, :null => false
t.column :created_by_id, :integer, :null => false
t.timestamps
@@ -60,7 +60,7 @@ class CreateNetwork < ActiveRecord::Migration
create_table :network_item_comments do |t|
t.references :network_item, :null => false
- t.column :body, :string, :limit => 20000, :null => false
+ t.column :body, :string, :limit => 20_000, :null => false
t.column :updated_by_id, :integer, :null => false
t.column :created_by_id, :integer, :null => false
t.timestamps
diff --git a/db/migrate/20140831000001_create_object_manager.rb b/db/migrate/20140831000001_create_object_manager.rb
index ba6c4efc1..87d905c86 100644
--- a/db/migrate/20140831000001_create_object_manager.rb
+++ b/db/migrate/20140831000001_create_object_manager.rb
@@ -454,7 +454,7 @@ class CreateObjectManager < ActiveRecord::Migration
:data_type => 'richtext',
:data_option => {
:type => 'richtext',
- :maxlength => 20000,
+ :maxlength => 20_000,
:upload => true,
:rows => 8,
:null => true,
diff --git a/lib/fill_db.rb b/lib/fill_db.rb
index 5d4bd1142..f6453ff93 100644
--- a/lib/fill_db.rb
+++ b/lib/fill_db.rb
@@ -14,7 +14,7 @@ module FillDB
organization_pool = []
if organizations && !organizations.zero?
(1..organizations).each {|count|
- organization = Organization.create( :name => 'FillOrganization::' + rand(999999).to_s, :active => true )
+ organization = Organization.create( :name => 'FillOrganization::' + rand(999_999).to_s, :active => true )
organization_pool.push organization
}
else
@@ -27,7 +27,7 @@ module FillDB
roles = Role.where( :name => [ 'Agent'] )
groups_all = Group.all
(1..agents).each {|count|
- suffix = rand(99999).to_s
+ suffix = rand(99_999).to_s
user = User.create_or_update(
:login => "filldb-agent-#{suffix}",
:firstname => "agent #{suffix}",
@@ -51,7 +51,7 @@ module FillDB
roles = Role.where( :name => [ 'Customer'] )
groups_all = Group.all
(1..customers).each {|count|
- suffix = rand(99999).to_s
+ suffix = rand(99_999).to_s
organization = nil
if !organization_pool.empty? && rand(2) == 1
organization = organization_pool[ organization_pool.length-1 ]
@@ -77,7 +77,7 @@ module FillDB
if groups && !groups.zero?
puts "1..#{groups}"
(1..groups).each {|count|
- group = Group.create( :name => 'FillGroup::' + rand(999999).to_s, :active => true )
+ group = Group.create( :name => 'FillGroup::' + rand(999_999).to_s, :active => true )
group_pool.push group
Role.where(:name => 'Agent').first.users.where(:active => true).each {|user|
user_groups = user.groups
@@ -98,7 +98,7 @@ module FillDB
customer = customer_pool[ rand(customer_pool.length-1) ]
agent = agent_pool[ rand(agent_pool.length-1) ]
ticket = Ticket.create(
- :title => 'some title äöüß' + rand(999999).to_s,
+ :title => 'some title äöüß' + rand(999_999).to_s,
:group => group_pool[ rand(group_pool.length-1) ],
:customer => customer,
:owner => agent,
@@ -112,8 +112,8 @@ module FillDB
:ticket_id => ticket.id,
:from => customer.email,
:to => 'some_recipient@example.com',
- :subject => 'some subject' + rand(999999).to_s,
- :message_id => 'some@id-' + rand(999999).to_s,
+ :subject => 'some subject' + rand(999_999).to_s,
+ :message_id => 'some@id-' + rand(999_999).to_s,
:body => 'some message ...',
:internal => false,
:sender => Ticket::Article::Sender.where(:name => 'Customer').first,
diff --git a/lib/session_helper.rb b/lib/session_helper.rb
index 1e98911f3..876b9dae8 100644
--- a/lib/session_helper.rb
+++ b/lib/session_helper.rb
@@ -39,7 +39,7 @@ module SessionHelper
ActiveRecord::SessionStore::Session.where( :id => id ).first
end
- def self.list(limit = 10000)
+ def self.list(limit = 10_000)
ActiveRecord::SessionStore::Session.order('updated_at DESC').limit(limit)
end
diff --git a/lib/sessions.rb b/lib/sessions.rb
index 4950aebcc..c72cdbf92 100644
--- a/lib/sessions.rb
+++ b/lib/sessions.rb
@@ -394,7 +394,7 @@ returns
def self.spool_create( msg )
path = @path + '/spool/'
FileUtils.mkpath path
- file = Time.new.to_f.to_s + '-' + rand(99999).to_s
+ file = Time.new.to_f.to_s + '-' + rand(99_999).to_s
File.open( path + '/' + file , 'wb' ) { |file|
data = {
:msg => msg,
@@ -428,7 +428,7 @@ returns
end
# ignore message older then 48h
- if spool['timestamp'] + (2 * 86400) < Time.now.to_i
+ if spool['timestamp'] + (2 * 86_400) < Time.now.to_i
to_delete.push path + '/' + entry
next
end
diff --git a/lib/time_calculation.rb b/lib/time_calculation.rb
index b0ad79507..0f69dc01e 100644
--- a/lib/time_calculation.rb
+++ b/lib/time_calculation.rb
@@ -152,7 +152,7 @@ put working hours matrix and timezone in function, returns UTC working hours mat
if config['holidays'].include?("#{year}-#{month}-#{day}")
# jump to next day
- start_time = start_time.beginning_of_day + 86400
+ start_time = start_time.beginning_of_day + 86_400
next
end
end
@@ -162,7 +162,7 @@ put working hours matrix and timezone in function, returns UTC working hours mat
if working_hours[ week_day_map[week_day] ].empty?
# jump to next day
- start_time = start_time.beginning_of_day + 86400
+ start_time = start_time.beginning_of_day + 86_400
next
end
@@ -211,7 +211,7 @@ put working hours matrix and timezone in function, returns UTC working hours mat
}
# loop to next day
- start_time = start_time.beginning_of_day + 86400
+ start_time = start_time.beginning_of_day + 86_400
end
diff = count / 60
@@ -273,7 +273,7 @@ put working hours matrix and timezone in function, returns UTC working hours mat
if config['holidays'].include?("#{year}-#{month}-#{day}")
# jump to next day
- start_time = start_time.beginning_of_day + 86400
+ start_time = start_time.beginning_of_day + 86_400
next
end
end
@@ -283,7 +283,7 @@ put working hours matrix and timezone in function, returns UTC working hours mat
if working_hours[ week_day_map[week_day] ].empty?
# jump to next day
- start_time = start_time.beginning_of_day + 86400
+ start_time = start_time.beginning_of_day + 86_400
next
end
@@ -349,7 +349,7 @@ put working hours matrix and timezone in function, returns UTC working hours mat
end
# loop to next day
- start_time = start_time.beginning_of_day + 86400
+ start_time = start_time.beginning_of_day + 86_400
end
return start_time
diff --git a/test/browser/agent_organization_profile_test.rb b/test/browser/agent_organization_profile_test.rb
index e722b2d3a..8c3ab3388 100644
--- a/test/browser/agent_organization_profile_test.rb
+++ b/test/browser/agent_organization_profile_test.rb
@@ -4,8 +4,8 @@ require 'browser_test_helper'
class AgentOrganizationProfileTest < TestCase
def test_org_profile
# work in one browser window
- message = '1 ' + rand(99999999).to_s
- note = 'some note ' + rand(99999999).to_s
+ message = '1 ' + rand(99_999_999).to_s
+ note = 'some note ' + rand(99_999_999).to_s
@browser = browser_instance
login(
@@ -84,7 +84,7 @@ class AgentOrganizationProfileTest < TestCase
# work with two browser windows
- message = 'comment 1 ' + rand(99999999999999999).to_s
+ message = 'comment 1 ' + rand(99_999_999_999_999_999).to_s
# use current session
browser1 = @browser
diff --git a/test/browser/agent_ticket_actions_level0_test.rb b/test/browser/agent_ticket_actions_level0_test.rb
index aacb81c5a..5d18800b5 100644
--- a/test/browser/agent_ticket_actions_level0_test.rb
+++ b/test/browser/agent_ticket_actions_level0_test.rb
@@ -3,8 +3,8 @@ require 'browser_test_helper'
class AgentTicketActionLevel0Test < TestCase
def test_text_modules
- random = 'text_module_test_' + rand(99999999).to_s
- random2 = 'text_module_test_' + rand(99999999).to_s
+ random = 'text_module_test_' + rand(99_999_999).to_s
+ random2 = 'text_module_test_' + rand(99_999_999).to_s
@browser = browser_instance
login(
@@ -57,9 +57,9 @@ class AgentTicketActionLevel0Test < TestCase
# test with two browser windows
- random = 'text_II_module_test_' + rand(99999999).to_s
+ random = 'text_II_module_test_' + rand(99_999_999).to_s
- user_rand = rand(99999999).to_s
+ user_rand = rand(99_999_999).to_s
login = 'agent-text-module-' + user_rand
firstname = 'Text' + user_rand
lastname = 'Module' + user_rand
diff --git a/test/browser/agent_ticket_actions_level2_test.rb b/test/browser/agent_ticket_actions_level2_test.rb
index d4ac9274f..59bc30dd3 100644
--- a/test/browser/agent_ticket_actions_level2_test.rb
+++ b/test/browser/agent_ticket_actions_level2_test.rb
@@ -5,7 +5,7 @@ class AgentTicketActionsLevel2Test < TestCase
def test_work_with_two_browser_on_same_ticket
# work on one ticket with two browsers
- message = 'message 1äöüß ' + rand(99999999999999999).to_s
+ message = 'message 1äöüß ' + rand(99_999_999_999_999_999).to_s
browser1 = browser_instance
login(
diff --git a/test/browser/agent_ticket_actions_level5_test.rb b/test/browser/agent_ticket_actions_level5_test.rb
index 88c872c3d..617b016c5 100644
--- a/test/browser/agent_ticket_actions_level5_test.rb
+++ b/test/browser/agent_ticket_actions_level5_test.rb
@@ -4,7 +4,7 @@ require 'browser_test_helper'
class AgentTicketActionLevel5Test < TestCase
def test_agent_signature_check
- suffix = rand(99999999999999999).to_s
+ suffix = rand(99_999_999_999_999_999).to_s
signature_name1 = 'sig name 1 äöüß ' + suffix
signature_body1 = "--\nsig body 1 äöüß " + suffix
signature_name2 = 'sig name 2 äöüß ' + suffix
diff --git a/test/browser/agent_ticket_actions_level6_test.rb b/test/browser/agent_ticket_actions_level6_test.rb
index 9dfcc8851..323161ce3 100644
--- a/test/browser/agent_ticket_actions_level6_test.rb
+++ b/test/browser/agent_ticket_actions_level6_test.rb
@@ -125,7 +125,7 @@ class AgentTicketActionLevel6Test < TestCase
tasks_close_all(
:browser => browser2,
)
- random = 'ticket-actions-6-test-' + rand(999999).to_s
+ random = 'ticket-actions-6-test-' + rand(999_999).to_s
user_email = random + '@example.com'
user_create(
:browser => browser2,
diff --git a/test/browser/agent_ticket_overview_level1_test.rb b/test/browser/agent_ticket_overview_level1_test.rb
index 7ccada7b2..3b2eb3abd 100644
--- a/test/browser/agent_ticket_overview_level1_test.rb
+++ b/test/browser/agent_ticket_overview_level1_test.rb
@@ -3,7 +3,7 @@ require 'browser_test_helper'
class AgentTicketOverviewLevel1Test < TestCase
def test_I
- name = 'name-' + rand(999999).to_s
+ name = 'name-' + rand(999_999).to_s
browser1 = browser_instance
login(
diff --git a/test/browser/agent_user_manage_test.rb b/test/browser/agent_user_manage_test.rb
index 72705dd56..3619b4233 100644
--- a/test/browser/agent_user_manage_test.rb
+++ b/test/browser/agent_user_manage_test.rb
@@ -3,7 +3,7 @@ require 'browser_test_helper'
class AgentUserManageTest < TestCase
def test_agent_user
- customer_user_email = 'customer-test-' + rand(999999).to_s + '@example.com'
+ customer_user_email = 'customer-test-' + rand(999_999).to_s + '@example.com'
firstname = 'Customer Firstname'
lastname = 'Customer Lastname'
fullname = "#{ firstname } #{ lastname } <#{ customer_user_email }>"
diff --git a/test/browser/agent_user_profile_test.rb b/test/browser/agent_user_profile_test.rb
index b0469ab9e..f2be1be42 100644
--- a/test/browser/agent_user_profile_test.rb
+++ b/test/browser/agent_user_profile_test.rb
@@ -3,7 +3,7 @@ require 'browser_test_helper'
class AgentUserProfileTest < TestCase
def test_user_profile
- message = '1 ' + rand(99999999).to_s
+ message = '1 ' + rand(99_999_999).to_s
@browser = browser_instance
login(
@@ -80,7 +80,7 @@ class AgentUserProfileTest < TestCase
# work with two browser windows
- message = 'comment 1 ' + rand(99999999999999999).to_s
+ message = 'comment 1 ' + rand(99_999_999_999_999_999).to_s
# use current session
browser1 = @browser
diff --git a/test/browser/chat_test.rb b/test/browser/chat_test.rb
index c911510b6..ffcf2f4ff 100644
--- a/test/browser/chat_test.rb
+++ b/test/browser/chat_test.rb
@@ -4,7 +4,7 @@ require 'browser_test_helper'
class ChatTest < TestCase
def test_websocket
return # TODO: temp disable
- message = 'message 1äöüß ' + rand(99999999999999999).to_s
+ message = 'message 1äöüß ' + rand(99_999_999_999_999_999).to_s
tests = [
{
:name => 'start',
diff --git a/test/browser/maintenance_message_test.rb b/test/browser/maintenance_message_test.rb
index 954970f91..9e0a13eab 100644
--- a/test/browser/maintenance_message_test.rb
+++ b/test/browser/maintenance_message_test.rb
@@ -3,7 +3,7 @@ require 'browser_test_helper'
class MaintenanceMessageTest < TestCase
def test_websocket
- string = rand(99999999999999999).to_s
+ string = rand(99_999_999_999_999_999).to_s
title_html = "test #{string}"
title_text = "test #{string}<\/b>"
message_html = "message 1äöüß #{string}\n\n\nhttp://zammad.org"
diff --git a/test/browser/manage_test.rb b/test/browser/manage_test.rb
index 80eba86a5..e59ba355f 100644
--- a/test/browser/manage_test.rb
+++ b/test/browser/manage_test.rb
@@ -3,7 +3,7 @@ require 'browser_test_helper'
class ManageTest < TestCase
def test_user
- random = 'manage-test-' + rand(999999).to_s
+ random = 'manage-test-' + rand(999_999).to_s
user_email = random + '@example.com'
# user management
diff --git a/test/browser/signup_password_change_and_reset_test.rb b/test/browser/signup_password_change_and_reset_test.rb
index efde3658a..32b192c00 100644
--- a/test/browser/signup_password_change_and_reset_test.rb
+++ b/test/browser/signup_password_change_and_reset_test.rb
@@ -3,7 +3,7 @@ require 'browser_test_helper'
class SignupPasswordChangeAndResetTest < TestCase
def test_signup
- signup_user_email = 'signup-test-' + rand(999999).to_s + '@example.com'
+ signup_user_email = 'signup-test-' + rand(999_999).to_s + '@example.com'
@browser = browser_instance
location( :url => browser_url )
click( :css => 'a[href="#signup"]' )
diff --git a/test/unit/cache_test.rb b/test/unit/cache_test.rb
index 1af177008..fa0837866 100644
--- a/test/unit/cache_test.rb
+++ b/test/unit/cache_test.rb
@@ -114,8 +114,8 @@ class CacheTest < ActiveSupport::TestCase
# verify if second cache write overwrite first one
test 'cache reset' do
Cache.write( 'some_reset_key', 123 )
- Cache.write( 'some_reset_key', 12356 )
+ Cache.write( 'some_reset_key', 12_356 )
cache = Cache.get( 'some_reset_key' )
- assert_equal( cache, 12356, 'verify' )
+ assert_equal( cache, 12_356, 'verify' )
end
end
\ No newline at end of file
diff --git a/test/unit/object_cache_test.rb b/test/unit/object_cache_test.rb
index 1441b3159..d0fbc09bc 100644
--- a/test/unit/object_cache_test.rb
+++ b/test/unit/object_cache_test.rb
@@ -4,7 +4,7 @@ require 'test_helper'
class ObjectCacheTest < ActiveSupport::TestCase
test 'object cache' do
- name = 'object cache test ' + rand(9999999).to_s
+ name = 'object cache test ' + rand(9_999_999).to_s
group = Group.create(
:name => name,
:updated_by_id => 1,
diff --git a/test/unit/recent_view_test.rb b/test/unit/recent_view_test.rb
index f4964cbbb..5cfad3ada 100644
--- a/test/unit/recent_view_test.rb
+++ b/test/unit/recent_view_test.rb
@@ -71,7 +71,7 @@ class RecentViewTest < ActiveSupport::TestCase
# log entry of not existing record
RecentView.user_log_destroy(user)
- RecentView.log( 'User', 99999999, user )
+ RecentView.log( 'User', 99_999_999, user )
# check if list is empty
list = RecentView.list( user )
@@ -80,7 +80,7 @@ class RecentViewTest < ActiveSupport::TestCase
# log entry of not existing model with permission check
RecentView.user_log_destroy(user)
- RecentView.log( 'Overview', 99999999, user )
+ RecentView.log( 'Overview', 99_999_999, user )
# check if list is empty
list = RecentView.list( user )
diff --git a/test/unit/session_basic_test.rb b/test/unit/session_basic_test.rb
index 6e01353f2..7b12e562d 100644
--- a/test/unit/session_basic_test.rb
+++ b/test/unit/session_basic_test.rb
@@ -88,7 +88,7 @@ class SessionBasicTest < ActiveSupport::TestCase
assert_equal( result1, result2, 'check collections' )
# change collection
- group = Group.create( :name => 'SomeGroup::' + rand(999999).to_s, :active => true )
+ group = Group.create( :name => 'SomeGroup::' + rand(999_999).to_s, :active => true )
sleep 4
# get whole collections
@@ -135,7 +135,7 @@ class SessionBasicTest < ActiveSupport::TestCase
require 'sessions/backend/collections/organization.rb'
UserInfo.current_user_id = 2
user = User.lookup(:id => 1)
- org = Organization.create( :name => 'SomeOrg1::' + rand(999999).to_s, :active => true )
+ org = Organization.create( :name => 'SomeOrg1::' + rand(999_999).to_s, :active => true )
collection_client1 = Sessions::Backend::Collections::Organization.new(user, false, '123-1', 3)
collection_client2 = Sessions::Backend::Collections::Organization.new(user, false, '234-2', 3)
@@ -155,7 +155,7 @@ class SessionBasicTest < ActiveSupport::TestCase
assert( !result2, 'check collections - recall' )
# change collection
- org = Organization.create( :name => 'SomeOrg2::' + rand(999999).to_s, :active => true )
+ org = Organization.create( :name => 'SomeOrg2::' + rand(999_999).to_s, :active => true )
sleep 4
# get whole collections
@@ -211,7 +211,7 @@ class SessionBasicTest < ActiveSupport::TestCase
agent1 = User.create_or_update(
:login => 'activity-stream-agent-1',
:firstname => 'Session',
- :lastname => 'activity stream ' + rand(99999).to_s,
+ :lastname => 'activity stream ' + rand(99_999).to_s,
:email => 'activity-stream-agent1@example.com',
:password => 'agentpw',
:active => true,
@@ -267,7 +267,7 @@ class SessionBasicTest < ActiveSupport::TestCase
result1 = ticket_create_client1.push
assert( !result1, 'check ticket_create - recall 2' )
- Group.create( :name => 'SomeTicketCreateGroup::' + rand(999999).to_s, :active => true )
+ Group.create( :name => 'SomeTicketCreateGroup::' + rand(999_999).to_s, :active => true )
sleep 4
diff --git a/test/unit/session_basic_ticket_test.rb b/test/unit/session_basic_ticket_test.rb
index 44a945d16..a98b9e12a 100644
--- a/test/unit/session_basic_ticket_test.rb
+++ b/test/unit/session_basic_ticket_test.rb
@@ -13,7 +13,7 @@ class SessionBasicTicketTest < ActiveSupport::TestCase
agent1 = User.create_or_update(
:login => 'activity-stream-agent-1',
:firstname => 'Session',
- :lastname => 'activity stream ' + rand(99999).to_s,
+ :lastname => 'activity stream ' + rand(99_999).to_s,
:email => 'activity-stream-agent1@example.com',
:password => 'agentpw',
:active => true,
@@ -59,7 +59,7 @@ class SessionBasicTicketTest < ActiveSupport::TestCase
agent1 = User.create_or_update(
:login => 'activity-stream-agent-1',
:firstname => 'Session',
- :lastname => 'activity stream ' + rand(99999).to_s,
+ :lastname => 'activity stream ' + rand(99_999).to_s,
:email => 'activity-stream-agent1@example.com',
:password => 'agentpw',
:active => true,
diff --git a/test/unit/session_collections_test.rb b/test/unit/session_collections_test.rb
index 2203b4982..4e125e5dc 100644
--- a/test/unit/session_collections_test.rb
+++ b/test/unit/session_collections_test.rb
@@ -108,7 +108,7 @@ class SessionCollectionsTest < ActiveSupport::TestCase
assert( check_if_collection_exists(result3, :Group), 'check collections - after touch' )
# change collection
- org = Organization.create( :name => 'SomeOrg::' + rand(999999).to_s, :active => true, :member_ids => [customer1.id] )
+ org = Organization.create( :name => 'SomeOrg::' + rand(999_999).to_s, :active => true, :member_ids => [customer1.id] )
sleep 4
# get whole collections
diff --git a/test/unit/session_enhanced_test.rb b/test/unit/session_enhanced_test.rb
index 5f68437f8..d559f3e1c 100644
--- a/test/unit/session_enhanced_test.rb
+++ b/test/unit/session_enhanced_test.rb
@@ -205,7 +205,7 @@ class SessionEnhancedTest < ActiveSupport::TestCase
)
agent2.roles = roles
agent2.save
- org = Organization.create( :name => 'SomeOrg::' + rand(999999).to_s, :active => true )
+ org = Organization.create( :name => 'SomeOrg::' + rand(999_999).to_s, :active => true )
# create sessions
client_id1_0 = '1234-1'
diff --git a/test/unit/working_time_test.rb b/test/unit/working_time_test.rb
index f1d6fb1a5..598fbaa0f 100644
--- a/test/unit/working_time_test.rb
+++ b/test/unit/working_time_test.rb
@@ -110,7 +110,7 @@ class WorkingTimeTest < ActiveSupport::TestCase
{
:start => '2012-02-28 17:00:00',
:end => '2013-03-08 23:59:59',
- :diff => 160860,
+ :diff => 160_860,
:config => {
'Mon' => true,
'Tue' => true,
@@ -550,7 +550,7 @@ class WorkingTimeTest < ActiveSupport::TestCase
]
tests.each { |test|
dest_time = TimeCalculation.dest_time( test[:start] + ' UTC', test[:diff], test[:config], test[:timezone] )
- assert_equal( dest_time.gmtime, Time.parse( test[:dest_time] + ' UTC' ), "dest time - #{test[:dest_time].to_s}" )
+ assert_equal( dest_time.gmtime, Time.parse( test[:dest_time] + ' UTC' ), "dest time - #{test[:dest_time]}" )
}
end