Moved to rubocop Style/NumericLiterals.
This commit is contained in:
parent
4f41d596c5
commit
a299f79598
32 changed files with 65 additions and 65 deletions
|
@ -609,7 +609,7 @@ curl http://localhost/api/v1/getting_started -v -u #{login}:#{password}
|
||||||
|
|
||||||
# send verify email to inbox
|
# send verify email to inbox
|
||||||
if !params[:subject]
|
if !params[:subject]
|
||||||
subject = '#' + rand(99999999999).to_s
|
subject = '#' + rand(99_999_999_999).to_s
|
||||||
else
|
else
|
||||||
subject = params[:subject]
|
subject = params[:subject]
|
||||||
end
|
end
|
||||||
|
|
|
@ -149,7 +149,7 @@ class LongPollingController < ApplicationController
|
||||||
private
|
private
|
||||||
|
|
||||||
def client_id_gen
|
def client_id_gen
|
||||||
rand(9999999999).to_s
|
rand(9_999_999_999).to_s
|
||||||
end
|
end
|
||||||
|
|
||||||
def client_id_verify
|
def client_id_verify
|
||||||
|
|
|
@ -45,7 +45,7 @@ class SessionsController < ApplicationController
|
||||||
# check logon session
|
# check logon session
|
||||||
logon_session_key = nil
|
logon_session_key = nil
|
||||||
if params['logon_session']
|
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 = ActiveRecord::SessionStore::Session.create(
|
||||||
# :session_id => logon_session_key,
|
# :session_id => logon_session_key,
|
||||||
# :data => {
|
# :data => {
|
||||||
|
|
|
@ -28,7 +28,7 @@ class Observer::Ticket::Article::FillupFromEmail < ActiveRecord::Observer
|
||||||
|
|
||||||
# generate message id
|
# generate message id
|
||||||
fqdn = Setting.get('fqdn')
|
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
|
# set sender
|
||||||
email_address = ticket.group.email_address
|
email_address = ticket.group.email_address
|
||||||
|
|
|
@ -57,8 +57,8 @@ returns
|
||||||
get attachment of object
|
get attachment of object
|
||||||
|
|
||||||
list = Store.list(
|
list = Store.list(
|
||||||
:object => 'Ticket::Article',
|
:object => 'Ticket::Article',
|
||||||
:o_id => 4711,
|
:o_id => 4711,
|
||||||
)
|
)
|
||||||
|
|
||||||
returns
|
returns
|
||||||
|
@ -66,9 +66,9 @@ returns
|
||||||
result = [store1, store2]
|
result = [store1, store2]
|
||||||
|
|
||||||
store1 = {
|
store1 = {
|
||||||
:size => 94123,
|
:size => 94123,
|
||||||
:filename => 'image.png',
|
:filename => 'image.png',
|
||||||
:preferences => {
|
:preferences => {
|
||||||
:content_type => 'image/png',
|
:content_type => 'image/png',
|
||||||
:content_id => 234,
|
:content_id => 234,
|
||||||
}
|
}
|
||||||
|
@ -90,8 +90,8 @@ returns
|
||||||
remove attachments of object from storage
|
remove attachments of object from storage
|
||||||
|
|
||||||
result = Store.remove(
|
result = Store.remove(
|
||||||
:object => 'Ticket::Article',
|
:object => 'Ticket::Article',
|
||||||
:o_id => 4711,
|
:o_id => 4711,
|
||||||
)
|
)
|
||||||
|
|
||||||
returns
|
returns
|
||||||
|
|
|
@ -34,7 +34,7 @@ Zammad::Application.configure do
|
||||||
config.middleware.use(Rack::LiveReload,
|
config.middleware.use(Rack::LiveReload,
|
||||||
:min_delay => 500, # default 1000
|
:min_delay => 500, # default 1000
|
||||||
:max_delay => 10_000, # default 60_000
|
:max_delay => 10_000, # default 60_000
|
||||||
:live_reload_port => 35738,
|
:live_reload_port => 35_738,
|
||||||
:source => :vendored
|
:source => :vendored
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ class CreateNetwork < ActiveRecord::Migration
|
||||||
create_table :network_items do |t|
|
create_table :network_items do |t|
|
||||||
t.references :network_category, :null => false
|
t.references :network_category, :null => false
|
||||||
t.column :title, :string, :limit => 200, :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 :updated_by_id, :integer, :null => false
|
||||||
t.column :created_by_id, :integer, :null => false
|
t.column :created_by_id, :integer, :null => false
|
||||||
t.timestamps
|
t.timestamps
|
||||||
|
@ -60,7 +60,7 @@ class CreateNetwork < ActiveRecord::Migration
|
||||||
|
|
||||||
create_table :network_item_comments do |t|
|
create_table :network_item_comments do |t|
|
||||||
t.references :network_item, :null => false
|
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 :updated_by_id, :integer, :null => false
|
||||||
t.column :created_by_id, :integer, :null => false
|
t.column :created_by_id, :integer, :null => false
|
||||||
t.timestamps
|
t.timestamps
|
||||||
|
|
|
@ -454,7 +454,7 @@ class CreateObjectManager < ActiveRecord::Migration
|
||||||
:data_type => 'richtext',
|
:data_type => 'richtext',
|
||||||
:data_option => {
|
:data_option => {
|
||||||
:type => 'richtext',
|
:type => 'richtext',
|
||||||
:maxlength => 20000,
|
:maxlength => 20_000,
|
||||||
:upload => true,
|
:upload => true,
|
||||||
:rows => 8,
|
:rows => 8,
|
||||||
:null => true,
|
:null => true,
|
||||||
|
|
|
@ -14,7 +14,7 @@ module FillDB
|
||||||
organization_pool = []
|
organization_pool = []
|
||||||
if organizations && !organizations.zero?
|
if organizations && !organizations.zero?
|
||||||
(1..organizations).each {|count|
|
(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
|
organization_pool.push organization
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -27,7 +27,7 @@ module FillDB
|
||||||
roles = Role.where( :name => [ 'Agent'] )
|
roles = Role.where( :name => [ 'Agent'] )
|
||||||
groups_all = Group.all
|
groups_all = Group.all
|
||||||
(1..agents).each {|count|
|
(1..agents).each {|count|
|
||||||
suffix = rand(99999).to_s
|
suffix = rand(99_999).to_s
|
||||||
user = User.create_or_update(
|
user = User.create_or_update(
|
||||||
:login => "filldb-agent-#{suffix}",
|
:login => "filldb-agent-#{suffix}",
|
||||||
:firstname => "agent #{suffix}",
|
:firstname => "agent #{suffix}",
|
||||||
|
@ -51,7 +51,7 @@ module FillDB
|
||||||
roles = Role.where( :name => [ 'Customer'] )
|
roles = Role.where( :name => [ 'Customer'] )
|
||||||
groups_all = Group.all
|
groups_all = Group.all
|
||||||
(1..customers).each {|count|
|
(1..customers).each {|count|
|
||||||
suffix = rand(99999).to_s
|
suffix = rand(99_999).to_s
|
||||||
organization = nil
|
organization = nil
|
||||||
if !organization_pool.empty? && rand(2) == 1
|
if !organization_pool.empty? && rand(2) == 1
|
||||||
organization = organization_pool[ organization_pool.length-1 ]
|
organization = organization_pool[ organization_pool.length-1 ]
|
||||||
|
@ -77,7 +77,7 @@ module FillDB
|
||||||
if groups && !groups.zero?
|
if groups && !groups.zero?
|
||||||
puts "1..#{groups}"
|
puts "1..#{groups}"
|
||||||
(1..groups).each {|count|
|
(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
|
group_pool.push group
|
||||||
Role.where(:name => 'Agent').first.users.where(:active => true).each {|user|
|
Role.where(:name => 'Agent').first.users.where(:active => true).each {|user|
|
||||||
user_groups = user.groups
|
user_groups = user.groups
|
||||||
|
@ -98,7 +98,7 @@ module FillDB
|
||||||
customer = customer_pool[ rand(customer_pool.length-1) ]
|
customer = customer_pool[ rand(customer_pool.length-1) ]
|
||||||
agent = agent_pool[ rand(agent_pool.length-1) ]
|
agent = agent_pool[ rand(agent_pool.length-1) ]
|
||||||
ticket = Ticket.create(
|
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) ],
|
:group => group_pool[ rand(group_pool.length-1) ],
|
||||||
:customer => customer,
|
:customer => customer,
|
||||||
:owner => agent,
|
:owner => agent,
|
||||||
|
@ -112,8 +112,8 @@ module FillDB
|
||||||
:ticket_id => ticket.id,
|
:ticket_id => ticket.id,
|
||||||
:from => customer.email,
|
:from => customer.email,
|
||||||
:to => 'some_recipient@example.com',
|
:to => 'some_recipient@example.com',
|
||||||
:subject => 'some subject' + rand(999999).to_s,
|
:subject => 'some subject' + rand(999_999).to_s,
|
||||||
:message_id => 'some@id-' + rand(999999).to_s,
|
:message_id => 'some@id-' + rand(999_999).to_s,
|
||||||
:body => 'some message ...',
|
:body => 'some message ...',
|
||||||
:internal => false,
|
:internal => false,
|
||||||
:sender => Ticket::Article::Sender.where(:name => 'Customer').first,
|
:sender => Ticket::Article::Sender.where(:name => 'Customer').first,
|
||||||
|
|
|
@ -39,7 +39,7 @@ module SessionHelper
|
||||||
ActiveRecord::SessionStore::Session.where( :id => id ).first
|
ActiveRecord::SessionStore::Session.where( :id => id ).first
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.list(limit = 10000)
|
def self.list(limit = 10_000)
|
||||||
ActiveRecord::SessionStore::Session.order('updated_at DESC').limit(limit)
|
ActiveRecord::SessionStore::Session.order('updated_at DESC').limit(limit)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -394,7 +394,7 @@ returns
|
||||||
def self.spool_create( msg )
|
def self.spool_create( msg )
|
||||||
path = @path + '/spool/'
|
path = @path + '/spool/'
|
||||||
FileUtils.mkpath path
|
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|
|
File.open( path + '/' + file , 'wb' ) { |file|
|
||||||
data = {
|
data = {
|
||||||
:msg => msg,
|
:msg => msg,
|
||||||
|
@ -428,7 +428,7 @@ returns
|
||||||
end
|
end
|
||||||
|
|
||||||
# ignore message older then 48h
|
# 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
|
to_delete.push path + '/' + entry
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
|
|
|
@ -152,7 +152,7 @@ put working hours matrix and timezone in function, returns UTC working hours mat
|
||||||
if config['holidays'].include?("#{year}-#{month}-#{day}")
|
if config['holidays'].include?("#{year}-#{month}-#{day}")
|
||||||
|
|
||||||
# jump to next day
|
# jump to next day
|
||||||
start_time = start_time.beginning_of_day + 86400
|
start_time = start_time.beginning_of_day + 86_400
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
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?
|
if working_hours[ week_day_map[week_day] ].empty?
|
||||||
|
|
||||||
# jump to next day
|
# jump to next day
|
||||||
start_time = start_time.beginning_of_day + 86400
|
start_time = start_time.beginning_of_day + 86_400
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -211,7 +211,7 @@ put working hours matrix and timezone in function, returns UTC working hours mat
|
||||||
}
|
}
|
||||||
|
|
||||||
# loop to next day
|
# loop to next day
|
||||||
start_time = start_time.beginning_of_day + 86400
|
start_time = start_time.beginning_of_day + 86_400
|
||||||
end
|
end
|
||||||
|
|
||||||
diff = count / 60
|
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}")
|
if config['holidays'].include?("#{year}-#{month}-#{day}")
|
||||||
|
|
||||||
# jump to next day
|
# jump to next day
|
||||||
start_time = start_time.beginning_of_day + 86400
|
start_time = start_time.beginning_of_day + 86_400
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
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?
|
if working_hours[ week_day_map[week_day] ].empty?
|
||||||
|
|
||||||
# jump to next day
|
# jump to next day
|
||||||
start_time = start_time.beginning_of_day + 86400
|
start_time = start_time.beginning_of_day + 86_400
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -349,7 +349,7 @@ put working hours matrix and timezone in function, returns UTC working hours mat
|
||||||
end
|
end
|
||||||
|
|
||||||
# loop to next day
|
# loop to next day
|
||||||
start_time = start_time.beginning_of_day + 86400
|
start_time = start_time.beginning_of_day + 86_400
|
||||||
end
|
end
|
||||||
|
|
||||||
return start_time
|
return start_time
|
||||||
|
|
|
@ -4,8 +4,8 @@ require 'browser_test_helper'
|
||||||
class AgentOrganizationProfileTest < TestCase
|
class AgentOrganizationProfileTest < TestCase
|
||||||
def test_org_profile
|
def test_org_profile
|
||||||
# work in one browser window
|
# work in one browser window
|
||||||
message = '1 ' + rand(99999999).to_s
|
message = '1 ' + rand(99_999_999).to_s
|
||||||
note = 'some note ' + rand(99999999).to_s
|
note = 'some note ' + rand(99_999_999).to_s
|
||||||
|
|
||||||
@browser = browser_instance
|
@browser = browser_instance
|
||||||
login(
|
login(
|
||||||
|
@ -84,7 +84,7 @@ class AgentOrganizationProfileTest < TestCase
|
||||||
|
|
||||||
|
|
||||||
# work with two browser windows
|
# 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
|
# use current session
|
||||||
browser1 = @browser
|
browser1 = @browser
|
||||||
|
|
|
@ -3,8 +3,8 @@ require 'browser_test_helper'
|
||||||
|
|
||||||
class AgentTicketActionLevel0Test < TestCase
|
class AgentTicketActionLevel0Test < TestCase
|
||||||
def test_text_modules
|
def test_text_modules
|
||||||
random = 'text_module_test_' + rand(99999999).to_s
|
random = 'text_module_test_' + rand(99_999_999).to_s
|
||||||
random2 = 'text_module_test_' + rand(99999999).to_s
|
random2 = 'text_module_test_' + rand(99_999_999).to_s
|
||||||
|
|
||||||
@browser = browser_instance
|
@browser = browser_instance
|
||||||
login(
|
login(
|
||||||
|
@ -57,9 +57,9 @@ class AgentTicketActionLevel0Test < TestCase
|
||||||
|
|
||||||
|
|
||||||
# test with two browser windows
|
# 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
|
login = 'agent-text-module-' + user_rand
|
||||||
firstname = 'Text' + user_rand
|
firstname = 'Text' + user_rand
|
||||||
lastname = 'Module' + user_rand
|
lastname = 'Module' + user_rand
|
||||||
|
|
|
@ -5,7 +5,7 @@ class AgentTicketActionsLevel2Test < TestCase
|
||||||
def test_work_with_two_browser_on_same_ticket
|
def test_work_with_two_browser_on_same_ticket
|
||||||
|
|
||||||
# work on one ticket with two browsers
|
# 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
|
browser1 = browser_instance
|
||||||
login(
|
login(
|
||||||
|
|
|
@ -4,7 +4,7 @@ require 'browser_test_helper'
|
||||||
class AgentTicketActionLevel5Test < TestCase
|
class AgentTicketActionLevel5Test < TestCase
|
||||||
def test_agent_signature_check
|
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_name1 = 'sig name 1 äöüß ' + suffix
|
||||||
signature_body1 = "--\nsig body 1 äöüß " + suffix
|
signature_body1 = "--\nsig body 1 äöüß " + suffix
|
||||||
signature_name2 = 'sig name 2 äöüß ' + suffix
|
signature_name2 = 'sig name 2 äöüß ' + suffix
|
||||||
|
|
|
@ -125,7 +125,7 @@ class AgentTicketActionLevel6Test < TestCase
|
||||||
tasks_close_all(
|
tasks_close_all(
|
||||||
:browser => browser2,
|
: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_email = random + '@example.com'
|
||||||
user_create(
|
user_create(
|
||||||
:browser => browser2,
|
:browser => browser2,
|
||||||
|
|
|
@ -3,7 +3,7 @@ require 'browser_test_helper'
|
||||||
|
|
||||||
class AgentTicketOverviewLevel1Test < TestCase
|
class AgentTicketOverviewLevel1Test < TestCase
|
||||||
def test_I
|
def test_I
|
||||||
name = 'name-' + rand(999999).to_s
|
name = 'name-' + rand(999_999).to_s
|
||||||
|
|
||||||
browser1 = browser_instance
|
browser1 = browser_instance
|
||||||
login(
|
login(
|
||||||
|
|
|
@ -3,7 +3,7 @@ require 'browser_test_helper'
|
||||||
|
|
||||||
class AgentUserManageTest < TestCase
|
class AgentUserManageTest < TestCase
|
||||||
def test_agent_user
|
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'
|
firstname = 'Customer Firstname'
|
||||||
lastname = 'Customer Lastname'
|
lastname = 'Customer Lastname'
|
||||||
fullname = "#{ firstname } #{ lastname } <#{ customer_user_email }>"
|
fullname = "#{ firstname } #{ lastname } <#{ customer_user_email }>"
|
||||||
|
|
|
@ -3,7 +3,7 @@ require 'browser_test_helper'
|
||||||
|
|
||||||
class AgentUserProfileTest < TestCase
|
class AgentUserProfileTest < TestCase
|
||||||
def test_user_profile
|
def test_user_profile
|
||||||
message = '1 ' + rand(99999999).to_s
|
message = '1 ' + rand(99_999_999).to_s
|
||||||
|
|
||||||
@browser = browser_instance
|
@browser = browser_instance
|
||||||
login(
|
login(
|
||||||
|
@ -80,7 +80,7 @@ class AgentUserProfileTest < TestCase
|
||||||
|
|
||||||
|
|
||||||
# work with two browser windows
|
# 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
|
# use current session
|
||||||
browser1 = @browser
|
browser1 = @browser
|
||||||
|
|
|
@ -4,7 +4,7 @@ require 'browser_test_helper'
|
||||||
class ChatTest < TestCase
|
class ChatTest < TestCase
|
||||||
def test_websocket
|
def test_websocket
|
||||||
return # TODO: temp disable
|
return # TODO: temp disable
|
||||||
message = 'message 1äöüß ' + rand(99999999999999999).to_s
|
message = 'message 1äöüß ' + rand(99_999_999_999_999_999).to_s
|
||||||
tests = [
|
tests = [
|
||||||
{
|
{
|
||||||
:name => 'start',
|
:name => 'start',
|
||||||
|
|
|
@ -3,7 +3,7 @@ require 'browser_test_helper'
|
||||||
|
|
||||||
class MaintenanceMessageTest < TestCase
|
class MaintenanceMessageTest < TestCase
|
||||||
def test_websocket
|
def test_websocket
|
||||||
string = rand(99999999999999999).to_s
|
string = rand(99_999_999_999_999_999).to_s
|
||||||
title_html = "test <b>#{string}</b>"
|
title_html = "test <b>#{string}</b>"
|
||||||
title_text = "test <b>#{string}<\/b>"
|
title_text = "test <b>#{string}<\/b>"
|
||||||
message_html = "message <b>1äöüß</b> #{string}\n\n\nhttp://zammad.org"
|
message_html = "message <b>1äöüß</b> #{string}\n\n\nhttp://zammad.org"
|
||||||
|
|
|
@ -3,7 +3,7 @@ require 'browser_test_helper'
|
||||||
|
|
||||||
class ManageTest < TestCase
|
class ManageTest < TestCase
|
||||||
def test_user
|
def test_user
|
||||||
random = 'manage-test-' + rand(999999).to_s
|
random = 'manage-test-' + rand(999_999).to_s
|
||||||
user_email = random + '@example.com'
|
user_email = random + '@example.com'
|
||||||
|
|
||||||
# user management
|
# user management
|
||||||
|
|
|
@ -3,7 +3,7 @@ require 'browser_test_helper'
|
||||||
|
|
||||||
class SignupPasswordChangeAndResetTest < TestCase
|
class SignupPasswordChangeAndResetTest < TestCase
|
||||||
def test_signup
|
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
|
@browser = browser_instance
|
||||||
location( :url => browser_url )
|
location( :url => browser_url )
|
||||||
click( :css => 'a[href="#signup"]' )
|
click( :css => 'a[href="#signup"]' )
|
||||||
|
|
|
@ -114,8 +114,8 @@ class CacheTest < ActiveSupport::TestCase
|
||||||
# verify if second cache write overwrite first one
|
# verify if second cache write overwrite first one
|
||||||
test 'cache reset' do
|
test 'cache reset' do
|
||||||
Cache.write( 'some_reset_key', 123 )
|
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' )
|
cache = Cache.get( 'some_reset_key' )
|
||||||
assert_equal( cache, 12356, 'verify' )
|
assert_equal( cache, 12_356, 'verify' )
|
||||||
end
|
end
|
||||||
end
|
end
|
|
@ -4,7 +4,7 @@ require 'test_helper'
|
||||||
class ObjectCacheTest < ActiveSupport::TestCase
|
class ObjectCacheTest < ActiveSupport::TestCase
|
||||||
test 'object cache' do
|
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(
|
group = Group.create(
|
||||||
:name => name,
|
:name => name,
|
||||||
:updated_by_id => 1,
|
:updated_by_id => 1,
|
||||||
|
|
|
@ -71,7 +71,7 @@ class RecentViewTest < ActiveSupport::TestCase
|
||||||
|
|
||||||
# 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', 99999999, user )
|
RecentView.log( 'User', 99_999_999, user )
|
||||||
|
|
||||||
# check if list is empty
|
# check if list is empty
|
||||||
list = RecentView.list( user )
|
list = RecentView.list( user )
|
||||||
|
@ -80,7 +80,7 @@ class RecentViewTest < ActiveSupport::TestCase
|
||||||
|
|
||||||
# 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', 99999999, user )
|
RecentView.log( 'Overview', 99_999_999, user )
|
||||||
|
|
||||||
# check if list is empty
|
# check if list is empty
|
||||||
list = RecentView.list( user )
|
list = RecentView.list( user )
|
||||||
|
|
|
@ -88,7 +88,7 @@ class SessionBasicTest < ActiveSupport::TestCase
|
||||||
assert_equal( result1, result2, 'check collections' )
|
assert_equal( result1, result2, 'check collections' )
|
||||||
|
|
||||||
# change collection
|
# 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
|
sleep 4
|
||||||
|
|
||||||
# get whole collections
|
# get whole collections
|
||||||
|
@ -135,7 +135,7 @@ class SessionBasicTest < ActiveSupport::TestCase
|
||||||
require 'sessions/backend/collections/organization.rb'
|
require 'sessions/backend/collections/organization.rb'
|
||||||
UserInfo.current_user_id = 2
|
UserInfo.current_user_id = 2
|
||||||
user = User.lookup(:id => 1)
|
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_client1 = Sessions::Backend::Collections::Organization.new(user, false, '123-1', 3)
|
||||||
collection_client2 = Sessions::Backend::Collections::Organization.new(user, false, '234-2', 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' )
|
assert( !result2, 'check collections - recall' )
|
||||||
|
|
||||||
# change collection
|
# 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
|
sleep 4
|
||||||
|
|
||||||
# get whole collections
|
# get whole collections
|
||||||
|
@ -211,7 +211,7 @@ class SessionBasicTest < ActiveSupport::TestCase
|
||||||
agent1 = User.create_or_update(
|
agent1 = User.create_or_update(
|
||||||
:login => 'activity-stream-agent-1',
|
:login => 'activity-stream-agent-1',
|
||||||
:firstname => 'Session',
|
:firstname => 'Session',
|
||||||
:lastname => 'activity stream ' + rand(99999).to_s,
|
:lastname => 'activity stream ' + rand(99_999).to_s,
|
||||||
:email => 'activity-stream-agent1@example.com',
|
:email => 'activity-stream-agent1@example.com',
|
||||||
:password => 'agentpw',
|
:password => 'agentpw',
|
||||||
:active => true,
|
:active => true,
|
||||||
|
@ -267,7 +267,7 @@ class SessionBasicTest < ActiveSupport::TestCase
|
||||||
result1 = ticket_create_client1.push
|
result1 = ticket_create_client1.push
|
||||||
assert( !result1, 'check ticket_create - recall 2' )
|
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
|
sleep 4
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ class SessionBasicTicketTest < ActiveSupport::TestCase
|
||||||
agent1 = User.create_or_update(
|
agent1 = User.create_or_update(
|
||||||
:login => 'activity-stream-agent-1',
|
:login => 'activity-stream-agent-1',
|
||||||
:firstname => 'Session',
|
:firstname => 'Session',
|
||||||
:lastname => 'activity stream ' + rand(99999).to_s,
|
:lastname => 'activity stream ' + rand(99_999).to_s,
|
||||||
:email => 'activity-stream-agent1@example.com',
|
:email => 'activity-stream-agent1@example.com',
|
||||||
:password => 'agentpw',
|
:password => 'agentpw',
|
||||||
:active => true,
|
:active => true,
|
||||||
|
@ -59,7 +59,7 @@ class SessionBasicTicketTest < ActiveSupport::TestCase
|
||||||
agent1 = User.create_or_update(
|
agent1 = User.create_or_update(
|
||||||
:login => 'activity-stream-agent-1',
|
:login => 'activity-stream-agent-1',
|
||||||
:firstname => 'Session',
|
:firstname => 'Session',
|
||||||
:lastname => 'activity stream ' + rand(99999).to_s,
|
:lastname => 'activity stream ' + rand(99_999).to_s,
|
||||||
:email => 'activity-stream-agent1@example.com',
|
:email => 'activity-stream-agent1@example.com',
|
||||||
:password => 'agentpw',
|
:password => 'agentpw',
|
||||||
:active => true,
|
:active => true,
|
||||||
|
|
|
@ -108,7 +108,7 @@ class SessionCollectionsTest < ActiveSupport::TestCase
|
||||||
assert( check_if_collection_exists(result3, :Group), 'check collections - after touch' )
|
assert( check_if_collection_exists(result3, :Group), 'check collections - after touch' )
|
||||||
|
|
||||||
# change collection
|
# 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
|
sleep 4
|
||||||
|
|
||||||
# get whole collections
|
# get whole collections
|
||||||
|
|
|
@ -205,7 +205,7 @@ class SessionEnhancedTest < ActiveSupport::TestCase
|
||||||
)
|
)
|
||||||
agent2.roles = roles
|
agent2.roles = roles
|
||||||
agent2.save
|
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
|
# create sessions
|
||||||
client_id1_0 = '1234-1'
|
client_id1_0 = '1234-1'
|
||||||
|
|
|
@ -110,7 +110,7 @@ class WorkingTimeTest < ActiveSupport::TestCase
|
||||||
{
|
{
|
||||||
:start => '2012-02-28 17:00:00',
|
:start => '2012-02-28 17:00:00',
|
||||||
:end => '2013-03-08 23:59:59',
|
:end => '2013-03-08 23:59:59',
|
||||||
:diff => 160860,
|
:diff => 160_860,
|
||||||
:config => {
|
:config => {
|
||||||
'Mon' => true,
|
'Mon' => true,
|
||||||
'Tue' => true,
|
'Tue' => true,
|
||||||
|
@ -550,7 +550,7 @@ class WorkingTimeTest < ActiveSupport::TestCase
|
||||||
]
|
]
|
||||||
tests.each { |test|
|
tests.each { |test|
|
||||||
dest_time = TimeCalculation.dest_time( test[:start] + ' UTC', test[:diff], test[:config], test[:timezone] )
|
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
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue