Updated rubocop(-* gems) to latest version (0.87.0).
This commit is contained in:
parent
6931fece7a
commit
b37e80df9a
27 changed files with 132 additions and 139 deletions
14
Gemfile.lock
14
Gemfile.lock
|
@ -451,24 +451,24 @@ GEM
|
|||
rspec-support (~> 3.8.0)
|
||||
rspec-support (3.8.0)
|
||||
rszr (0.5.2)
|
||||
rubocop (0.86.0)
|
||||
rubocop (0.87.0)
|
||||
parallel (~> 1.10)
|
||||
parser (>= 2.7.0.1)
|
||||
parser (>= 2.7.1.1)
|
||||
rainbow (>= 2.2.2, < 4.0)
|
||||
regexp_parser (>= 1.7)
|
||||
rexml
|
||||
rubocop-ast (>= 0.0.3, < 1.0)
|
||||
rubocop-ast (>= 0.1.0, < 1.0)
|
||||
ruby-progressbar (~> 1.7)
|
||||
unicode-display_width (>= 1.4.0, < 2.0)
|
||||
rubocop-ast (0.0.3)
|
||||
rubocop-ast (0.1.0)
|
||||
parser (>= 2.7.0.1)
|
||||
rubocop-performance (1.6.1)
|
||||
rubocop (>= 0.71.0)
|
||||
rubocop-performance (1.7.0)
|
||||
rubocop (>= 0.82.0)
|
||||
rubocop-rails (2.6.0)
|
||||
activesupport (>= 4.2.0)
|
||||
rack (>= 1.1)
|
||||
rubocop (>= 0.82.0)
|
||||
rubocop-rspec (1.40.0)
|
||||
rubocop-rspec (1.41.0)
|
||||
rubocop (>= 0.68.1)
|
||||
ruby-progressbar (1.10.1)
|
||||
ruby-saml (1.10.2)
|
||||
|
|
|
@ -61,7 +61,7 @@ class FormController < ApplicationController
|
|||
Rails.logger.info "Can't verify email #{params[:email]}: #{message}"
|
||||
|
||||
# ignore 450, graylistings
|
||||
errors['email'] = message if !message.match?(/450/)
|
||||
errors['email'] = message if !message.include?('450')
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ class ImportOtrsController < ApplicationController
|
|||
end
|
||||
|
||||
result = {}
|
||||
if response.body.match?(/zammad migrator/)
|
||||
if response.body.include?('zammad migrator')
|
||||
|
||||
migrator_response = JSON.parse(response.body)
|
||||
|
||||
|
|
|
@ -22,9 +22,8 @@ module KnowledgeBaseRichTextHelper
|
|||
end
|
||||
end
|
||||
|
||||
parsed = Loofah.scrub_fragment(input, scrubber).to_s.html_safe # rubocop:disable Rails/OutputSafety
|
||||
Loofah.scrub_fragment(input, scrubber).to_s.html_safe # rubocop:disable Rails/OutputSafety
|
||||
|
||||
parsed
|
||||
end
|
||||
|
||||
def prepare_rich_text_videos(input)
|
||||
|
|
|
@ -112,7 +112,7 @@ return all activity entries of an user
|
|||
permission_ids = user.permissions_with_child_ids
|
||||
group_ids = user.group_ids_access('read')
|
||||
|
||||
stream = if group_ids.blank?
|
||||
if group_ids.blank?
|
||||
ActivityStream.where('(permission_id IN (?) AND group_id IS NULL)', permission_ids)
|
||||
.order(created_at: :desc)
|
||||
.limit(limit)
|
||||
|
@ -121,7 +121,7 @@ return all activity entries of an user
|
|||
.order(created_at: :desc)
|
||||
.limit(limit)
|
||||
end
|
||||
stream
|
||||
|
||||
end
|
||||
|
||||
=begin
|
||||
|
|
|
@ -239,7 +239,7 @@ example
|
|||
timeout(FETCH_METADATA_TIMEOUT) do
|
||||
message_meta = @imap.fetch(message_id, ['RFC822.SIZE', 'ENVELOPE', 'FLAGS', 'INTERNALDATE', 'RFC822.HEADER'])[0]
|
||||
rescue Net::IMAP::ResponseParseError => e
|
||||
raise if !e.message.match?(/unknown token/)
|
||||
raise if !e.message.include?('unknown token')
|
||||
|
||||
result = 'error'
|
||||
notice += <<~NOTICE
|
||||
|
|
|
@ -26,8 +26,8 @@ class Channel::Driver::Telegram
|
|||
options = check_external_credential(options)
|
||||
|
||||
@client = Telegram.new(options[:auth][:api_key])
|
||||
message = @client.from_article(article)
|
||||
message
|
||||
@client.from_article(article)
|
||||
|
||||
end
|
||||
|
||||
=begin
|
||||
|
|
|
@ -78,10 +78,10 @@ returns
|
|||
# fallback do sql query
|
||||
# - stip out * we already search for *query* -
|
||||
query.delete! '*'
|
||||
chat_sessions = Chat::Session.where(
|
||||
Chat::Session.where(
|
||||
'name LIKE ?', "%#{query}%"
|
||||
).order('name').offset(offset).limit(limit).to_a
|
||||
chat_sessions
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -150,9 +150,8 @@ Checks if file is used inline
|
|||
node['src'] = Rails.application.routes.url_helpers.attachment_path(attachment.id)
|
||||
end
|
||||
|
||||
parsed = Loofah.scrub_fragment(raw, scrubber).to_s
|
||||
Loofah.scrub_fragment(raw, scrubber).to_s
|
||||
|
||||
parsed
|
||||
end
|
||||
|
||||
def has_rich_text_inline_cids(object, attr) # rubocop:disable Naming/PredicateName
|
||||
|
|
|
@ -118,13 +118,13 @@ return all online notifications of an object
|
|||
|
||||
def self.list_by_object(object_name, o_id)
|
||||
object_id = ObjectLookup.by_name(object_name)
|
||||
notifications = OnlineNotification.where(
|
||||
OnlineNotification.where(
|
||||
object_lookup_id: object_id,
|
||||
o_id: o_id,
|
||||
)
|
||||
.order(created_at: :desc)
|
||||
.limit(10_000)
|
||||
notifications
|
||||
|
||||
end
|
||||
|
||||
=begin
|
||||
|
|
|
@ -91,7 +91,7 @@ class Overview < ApplicationModel
|
|||
local_link = name.downcase
|
||||
local_link = local_link.parameterize(separator: '_')
|
||||
local_link.gsub!(/\s/, '_')
|
||||
local_link.gsub!(/_+/, '_')
|
||||
local_link.squeeze!('_')
|
||||
local_link = CGI.escape(local_link)
|
||||
if local_link.blank?
|
||||
local_link = id || rand(999)
|
||||
|
|
|
@ -64,7 +64,7 @@ install all packages located under auto_install/*.zpm
|
|||
|
||||
data = []
|
||||
Dir.foreach(path) do |entry|
|
||||
if entry =~ /\.zpm/ && entry !~ /^\./
|
||||
if entry.include?('.zpm') && entry !~ /^\./
|
||||
data.push entry
|
||||
end
|
||||
end
|
||||
|
|
|
@ -86,9 +86,9 @@ returns
|
|||
def self.list(data)
|
||||
# search
|
||||
store_object_id = Store::Object.lookup(name: data[:object])
|
||||
stores = Store.where(store_object_id: store_object_id, o_id: data[:o_id].to_i)
|
||||
Store.where(store_object_id: store_object_id, o_id: data[:o_id].to_i)
|
||||
.order(created_at: :asc)
|
||||
stores
|
||||
|
||||
end
|
||||
|
||||
=begin
|
||||
|
|
|
@ -134,7 +134,7 @@ returns
|
|||
# fallback do sql query
|
||||
# - stip out * we already search for *query* -
|
||||
query.delete! '*'
|
||||
users = if params[:role_ids]
|
||||
if params[:role_ids]
|
||||
User.joins(:roles).where('roles.id' => params[:role_ids]).where(
|
||||
'(users.firstname LIKE ? OR users.lastname LIKE ? OR users.email LIKE ? OR users.login LIKE ?) AND users.id != 1', "%#{query}%", "%#{query}%", "%#{query}%", "%#{query}%"
|
||||
)
|
||||
|
@ -149,7 +149,7 @@ returns
|
|||
.offset(offset)
|
||||
.limit(limit)
|
||||
end
|
||||
users
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# This file is used by Rack-based servers to start the application.
|
||||
|
||||
require ::File.expand_path('../config/environment', __FILE__)
|
||||
require ::File.expand_path('config/environment', __dir__)
|
||||
run Zammad::Application
|
||||
|
||||
# set config to do no self notification
|
||||
|
|
|
@ -156,8 +156,8 @@ returns
|
|||
|
||||
def self.file_location
|
||||
auto_wizard_file_name = 'auto_wizard.json'
|
||||
auto_wizard_file_location = Rails.root.join(auto_wizard_file_name)
|
||||
auto_wizard_file_location
|
||||
Rails.root.join(auto_wizard_file_name)
|
||||
|
||||
end
|
||||
private_class_method :file_location
|
||||
end
|
||||
|
|
|
@ -106,7 +106,7 @@ returns
|
|||
|
||||
def self.provider(email, password)
|
||||
# check domain based attributes
|
||||
provider_map = {
|
||||
{
|
||||
google_imap: {
|
||||
domain: 'gmail|googlemail|google',
|
||||
inbound: {
|
||||
|
@ -177,7 +177,7 @@ returns
|
|||
},
|
||||
},
|
||||
}
|
||||
provider_map
|
||||
|
||||
end
|
||||
|
||||
=begin
|
||||
|
@ -274,7 +274,7 @@ returns
|
|||
=end
|
||||
|
||||
def self.provider_inbound_guess(user, email, password, domain)
|
||||
inbound = [
|
||||
[
|
||||
{
|
||||
adapter: 'imap',
|
||||
options: {
|
||||
|
@ -376,7 +376,7 @@ returns
|
|||
},
|
||||
},
|
||||
]
|
||||
inbound
|
||||
|
||||
end
|
||||
|
||||
=begin
|
||||
|
@ -511,7 +511,7 @@ returns
|
|||
=end
|
||||
|
||||
def self.provider_outbound_guess(user, email, password, domain)
|
||||
outbound = [
|
||||
[
|
||||
{
|
||||
adapter: 'smtp',
|
||||
options: {
|
||||
|
@ -593,7 +593,7 @@ returns
|
|||
},
|
||||
},
|
||||
]
|
||||
outbound
|
||||
|
||||
end
|
||||
|
||||
=begin
|
||||
|
|
|
@ -66,7 +66,7 @@ class ExcelSheet::Ticket < ExcelSheet
|
|||
header.push object
|
||||
end
|
||||
|
||||
header = header.concat([
|
||||
header.concat([
|
||||
{ display: 'Created At', name: 'created_at', width: 18, data_type: 'datetime' },
|
||||
{ display: 'Updated At', name: 'updated_at', width: 18, data_type: 'datetime' },
|
||||
{ display: 'Closed At', name: 'close_at', width: 18, data_type: 'datetime' },
|
||||
|
@ -86,7 +86,7 @@ class ExcelSheet::Ticket < ExcelSheet
|
|||
{ display: 'Article Count', name: 'article_count', width: 10, data_type: 'integer' },
|
||||
{ display: 'Escalation At', name: 'escalation_at', width: 18, data_type: 'datetime' },
|
||||
])
|
||||
header
|
||||
|
||||
end
|
||||
|
||||
def gen_rows
|
||||
|
|
|
@ -779,7 +779,7 @@ generate url for index or document access (only for internal use)
|
|||
# add * on simple query like "somephrase23"
|
||||
def self.append_wildcard_to_simple_query(query)
|
||||
query.strip!
|
||||
query += '*' if !query.match?(/:/)
|
||||
query += '*' if !query.include?(':')
|
||||
query
|
||||
end
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ class Sequencer
|
|||
break if extractor.enough
|
||||
end
|
||||
rescue NoMethodError => e
|
||||
raise if !e.message.match?(/Viewpoint::EWS::/)
|
||||
raise if !e.message.include?('Viewpoint::EWS::')
|
||||
|
||||
logger.error e
|
||||
logger.error "Skipping folder_id '#{folder_id}' due to unsupported entries."
|
||||
|
|
|
@ -42,7 +42,7 @@ class Service::GeoLocation::Gmaps
|
|||
|
||||
result = JSON.parse(response.body)
|
||||
|
||||
address = result['results'].first['address_components'].first['long_name']
|
||||
address
|
||||
result['results'].first['address_components'].first['long_name']
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
class Sessions::Backend::Base
|
||||
|
||||
attr_writer :user
|
||||
attr_writer :time_now
|
||||
attr_writer :user, :time_now
|
||||
|
||||
def initialize(user, asset_lookup, client, client_id, ttl = 10)
|
||||
@user = user
|
||||
|
|
|
@ -511,11 +511,7 @@ returns
|
|||
|
||||
class Result
|
||||
|
||||
attr_reader :error
|
||||
attr_reader :body
|
||||
attr_reader :data
|
||||
attr_reader :code
|
||||
attr_reader :content_type
|
||||
attr_reader :error, :body, :data, :code, :content_type
|
||||
|
||||
def initialize(options)
|
||||
@success = options[:success]
|
||||
|
|
|
@ -811,7 +811,7 @@ class TestCase < ActiveSupport::TestCase
|
|||
end
|
||||
|
||||
# it's not working stable with ff via selenium, use js
|
||||
if browser =~ /firefox/i && params[:css] =~ /\[data-name=/
|
||||
if browser =~ /firefox/i && params[:css].include?('[data-name=')
|
||||
log('set_ff_trigger_workaround', params)
|
||||
instance.execute_script("$('#{params[:css]}').trigger('focusout')")
|
||||
end
|
||||
|
@ -1024,7 +1024,7 @@ class TestCase < ActiveSupport::TestCase
|
|||
instance = params[:browser] || @browser
|
||||
element = instance.find_elements(css: params[:css])[0]
|
||||
|
||||
if params[:css].match?(/select/)
|
||||
if params[:css].include?('select')
|
||||
dropdown = Selenium::WebDriver::Support::Select.new(element)
|
||||
success = false
|
||||
dropdown.selected_options&.each do |option|
|
||||
|
|
|
@ -23,9 +23,9 @@ class UserAgentTest < ActiveSupport::TestCase
|
|||
assert_equal(true, result.success?)
|
||||
assert_equal('200', result.code)
|
||||
assert_equal(String, result.body.class)
|
||||
assert(result.body =~ /"get"/)
|
||||
assert(result.body =~ /"123"/)
|
||||
assert(result.body =~ /"content_type_requested":null/)
|
||||
assert(result.body.include?('"get"'))
|
||||
assert(result.body.include?('"123"'))
|
||||
assert(result.body.include?('"content_type_requested":null'))
|
||||
if ENV['ZAMMAD_PROXY_TEST'] == 'true' && ENV['ZAMMAD_PROXY_REMOTE_IP_CHECK']
|
||||
assert_match(/"remote_ip":"#{ENV['ZAMMAD_PROXY_REMOTE_IP_CHECK']}"/, result.body)
|
||||
end
|
||||
|
@ -50,9 +50,9 @@ class UserAgentTest < ActiveSupport::TestCase
|
|||
assert_equal(true, result.success?)
|
||||
assert_equal('201', result.code)
|
||||
assert_equal(String, result.body.class)
|
||||
assert(result.body =~ /"post"/)
|
||||
assert(result.body =~ /"some value"/)
|
||||
assert(result.body =~ %r{"application/x-www-form-urlencoded"})
|
||||
assert(result.body.include?('"post"'))
|
||||
assert(result.body.include?('"some value"'))
|
||||
assert(result.body.include?('"application/x-www-form-urlencoded"'))
|
||||
if ENV['ZAMMAD_PROXY_TEST'] == 'true' && ENV['ZAMMAD_PROXY_REMOTE_IP_CHECK']
|
||||
assert_match(/"remote_ip":"#{ENV['ZAMMAD_PROXY_REMOTE_IP_CHECK']}"/, result.body)
|
||||
end
|
||||
|
@ -80,9 +80,9 @@ class UserAgentTest < ActiveSupport::TestCase
|
|||
assert_equal(true, result.success?)
|
||||
assert_equal('200', result.code)
|
||||
assert_equal(String, result.body.class)
|
||||
assert(result.body =~ /"put"/)
|
||||
assert(result.body =~ /"some value"/)
|
||||
assert(result.body =~ %r{"application/x-www-form-urlencoded"})
|
||||
assert(result.body.include?('"put"'))
|
||||
assert(result.body.include?('"some value"'))
|
||||
assert(result.body.include?('"application/x-www-form-urlencoded"'))
|
||||
if ENV['ZAMMAD_PROXY_TEST'] == 'true' && ENV['ZAMMAD_PROXY_REMOTE_IP_CHECK']
|
||||
assert_match(/"remote_ip":"#{ENV['ZAMMAD_PROXY_REMOTE_IP_CHECK']}"/, result.body)
|
||||
end
|
||||
|
@ -107,8 +107,8 @@ class UserAgentTest < ActiveSupport::TestCase
|
|||
assert_equal(true, result.success?)
|
||||
assert_equal('200', result.code)
|
||||
assert_equal(String, result.body.class)
|
||||
assert(result.body =~ /"delete"/)
|
||||
assert(result.body =~ /"content_type_requested":null/)
|
||||
assert(result.body.include?('"delete"'))
|
||||
assert(result.body.include?('"content_type_requested":null'))
|
||||
if ENV['ZAMMAD_PROXY_TEST'] == 'true' && ENV['ZAMMAD_PROXY_REMOTE_IP_CHECK']
|
||||
assert_match(/"remote_ip":"#{ENV['ZAMMAD_PROXY_REMOTE_IP_CHECK']}"/, result.body)
|
||||
end
|
||||
|
@ -137,9 +137,9 @@ class UserAgentTest < ActiveSupport::TestCase
|
|||
assert_equal(true, result.success?)
|
||||
assert_equal('200', result.code)
|
||||
assert_equal(String, result.body.class)
|
||||
assert(result.body =~ /"get"/)
|
||||
assert(result.body =~ /"123"/)
|
||||
assert(result.body =~ /"content_type_requested":null/)
|
||||
assert(result.body.include?('"get"'))
|
||||
assert(result.body.include?('"123"'))
|
||||
assert(result.body.include?('"content_type_requested":null'))
|
||||
if ENV['ZAMMAD_PROXY_TEST'] == 'true' && ENV['ZAMMAD_PROXY_REMOTE_IP_CHECK']
|
||||
assert_match(/"remote_ip":"#{ENV['ZAMMAD_PROXY_REMOTE_IP_CHECK']}"/, result.body)
|
||||
end
|
||||
|
@ -173,9 +173,9 @@ class UserAgentTest < ActiveSupport::TestCase
|
|||
assert_equal(true, result.success?)
|
||||
assert_equal('201', result.code)
|
||||
assert_equal(String, result.body.class)
|
||||
assert(result.body =~ /"post"/)
|
||||
assert(result.body =~ /"some value"/)
|
||||
assert(result.body =~ %r{"application/x-www-form-urlencoded"})
|
||||
assert(result.body.include?('"post"'))
|
||||
assert(result.body.include?('"some value"'))
|
||||
assert(result.body.include?('"application/x-www-form-urlencoded"'))
|
||||
if ENV['ZAMMAD_PROXY_TEST'] == 'true' && ENV['ZAMMAD_PROXY_REMOTE_IP_CHECK']
|
||||
assert_match(/"remote_ip":"#{ENV['ZAMMAD_PROXY_REMOTE_IP_CHECK']}"/, result.body)
|
||||
end
|
||||
|
@ -211,9 +211,9 @@ class UserAgentTest < ActiveSupport::TestCase
|
|||
assert_equal(true, result.success?)
|
||||
assert_equal('200', result.code)
|
||||
assert_equal(String, result.body.class)
|
||||
assert(result.body =~ /"put"/)
|
||||
assert(result.body =~ /"some value"/)
|
||||
assert(result.body =~ %r{"application/x-www-form-urlencoded"})
|
||||
assert(result.body.include?('"put"'))
|
||||
assert(result.body.include?('"some value"'))
|
||||
assert(result.body.include?('"application/x-www-form-urlencoded"'))
|
||||
if ENV['ZAMMAD_PROXY_TEST'] == 'true' && ENV['ZAMMAD_PROXY_REMOTE_IP_CHECK']
|
||||
assert_match(/"remote_ip":"#{ENV['ZAMMAD_PROXY_REMOTE_IP_CHECK']}"/, result.body)
|
||||
end
|
||||
|
@ -247,8 +247,8 @@ class UserAgentTest < ActiveSupport::TestCase
|
|||
assert_equal(true, result.success?)
|
||||
assert_equal('200', result.code)
|
||||
assert_equal(String, result.body.class)
|
||||
assert(result.body =~ /"delete"/)
|
||||
assert(result.body =~ /"content_type_requested":null/)
|
||||
assert(result.body.include?('"delete"'))
|
||||
assert(result.body.include?('"content_type_requested":null'))
|
||||
if ENV['ZAMMAD_PROXY_TEST'] == 'true' && ENV['ZAMMAD_PROXY_REMOTE_IP_CHECK']
|
||||
assert_match(/"remote_ip":"#{ENV['ZAMMAD_PROXY_REMOTE_IP_CHECK']}"/, result.body)
|
||||
end
|
||||
|
@ -279,9 +279,9 @@ class UserAgentTest < ActiveSupport::TestCase
|
|||
assert_equal(true, result.success?)
|
||||
assert_equal('200', result.code)
|
||||
assert_equal(String, result.body.class)
|
||||
assert(result.body =~ /"get"/)
|
||||
assert(result.body =~ /"abc"/)
|
||||
assert(result.body =~ /"content_type_requested":null/)
|
||||
assert(result.body.include?('"get"'))
|
||||
assert(result.body.include?('"abc"'))
|
||||
assert(result.body.include?('"content_type_requested":null'))
|
||||
if ENV['ZAMMAD_PROXY_TEST'] == 'true' && ENV['ZAMMAD_PROXY_REMOTE_IP_CHECK']
|
||||
assert_match(/"remote_ip":"#{ENV['ZAMMAD_PROXY_REMOTE_IP_CHECK']}"/, result.body)
|
||||
end
|
||||
|
@ -298,9 +298,9 @@ class UserAgentTest < ActiveSupport::TestCase
|
|||
assert_equal(true, result.success?)
|
||||
assert_equal('200', result.code)
|
||||
assert_equal(String, result.body.class)
|
||||
assert(result.body =~ /"get"/)
|
||||
assert(result.body =~ /"abc"/)
|
||||
assert(result.body =~ /"content_type_requested":null/)
|
||||
assert(result.body.include?('"get"'))
|
||||
assert(result.body.include?('"abc"'))
|
||||
assert(result.body.include?('"content_type_requested":null'))
|
||||
if ENV['ZAMMAD_PROXY_TEST'] == 'true' && ENV['ZAMMAD_PROXY_REMOTE_IP_CHECK']
|
||||
assert_match(/"remote_ip":"#{ENV['ZAMMAD_PROXY_REMOTE_IP_CHECK']}"/, result.body)
|
||||
end
|
||||
|
@ -330,9 +330,9 @@ class UserAgentTest < ActiveSupport::TestCase
|
|||
assert_equal(true, result.success?)
|
||||
assert_equal('200', result.code)
|
||||
assert_equal(String, result.body.class)
|
||||
assert(result.body =~ /"get"/)
|
||||
assert(result.body =~ /"123"/)
|
||||
assert(result.body =~ /"content_type_requested":null/)
|
||||
assert(result.body.include?('"get"'))
|
||||
assert(result.body.include?('"123"'))
|
||||
assert(result.body.include?('"content_type_requested":null'))
|
||||
if ENV['ZAMMAD_PROXY_TEST'] == 'true' && ENV['ZAMMAD_PROXY_REMOTE_IP_CHECK']
|
||||
assert_match(/"remote_ip":"#{ENV['ZAMMAD_PROXY_REMOTE_IP_CHECK']}"/, result.body)
|
||||
end
|
||||
|
@ -366,7 +366,7 @@ class UserAgentTest < ActiveSupport::TestCase
|
|||
assert_equal(true, result.success?)
|
||||
assert_equal('200', result.code)
|
||||
assert_equal(String, result.body.class)
|
||||
assert(result.body =~ /"GET"/)
|
||||
assert(result.body.include?('"GET"'))
|
||||
|
||||
# get / 200 / gzip
|
||||
result = UserAgent.request(
|
||||
|
@ -376,7 +376,7 @@ class UserAgentTest < ActiveSupport::TestCase
|
|||
assert_equal(true, result.success?)
|
||||
assert_equal('200', result.code)
|
||||
assert_equal(String, result.body.class)
|
||||
assert(result.body =~ /"GET"/)
|
||||
assert(result.body.include?('"GET"'))
|
||||
|
||||
# get / 200 / gzip
|
||||
result = UserAgent.request(
|
||||
|
@ -386,7 +386,7 @@ class UserAgentTest < ActiveSupport::TestCase
|
|||
assert_equal(true, result.success?)
|
||||
assert_equal('200', result.code)
|
||||
assert_equal(String, result.body.class)
|
||||
assert(result.body =~ /"GET"/)
|
||||
assert(result.body.include?('"GET"'))
|
||||
|
||||
# get / 200 / gzip
|
||||
result = UserAgent.request(
|
||||
|
@ -396,7 +396,7 @@ class UserAgentTest < ActiveSupport::TestCase
|
|||
assert_equal(true, result.success?)
|
||||
assert_equal('200', result.code)
|
||||
assert_equal(String, result.body.class)
|
||||
assert(result.body =~ /"GET"/)
|
||||
assert(result.body.include?('"GET"'))
|
||||
|
||||
end
|
||||
|
||||
|
@ -473,8 +473,8 @@ class UserAgentTest < ActiveSupport::TestCase
|
|||
assert_equal(true, result.success?)
|
||||
assert_equal('200', result.code)
|
||||
assert_equal(String, result.body.class)
|
||||
assert(result.body =~ /"content_type_requested"/)
|
||||
assert(result.body =~ %r{"application/json"})
|
||||
assert(result.body.include?('"content_type_requested"'))
|
||||
assert(result.body.include?('"application/json"'))
|
||||
assert_equal('some value ', result.data['submitted']['key'])
|
||||
if ENV['ZAMMAD_PROXY_TEST'] == 'true' && ENV['ZAMMAD_PROXY_REMOTE_IP_CHECK']
|
||||
assert_match(/"remote_ip":"#{ENV['ZAMMAD_PROXY_REMOTE_IP_CHECK']}"/, result.body)
|
||||
|
@ -510,8 +510,8 @@ class UserAgentTest < ActiveSupport::TestCase
|
|||
assert_equal(true, result.success?)
|
||||
assert_equal('201', result.code)
|
||||
assert_equal(String, result.body.class)
|
||||
assert(result.body =~ /"content_type_requested"/)
|
||||
assert(result.body =~ %r{"application/json"})
|
||||
assert(result.body.include?('"content_type_requested"'))
|
||||
assert(result.body.include?('"application/json"'))
|
||||
assert_equal('some value ', result.data['submitted']['key'])
|
||||
if ENV['ZAMMAD_PROXY_TEST'] == 'true' && ENV['ZAMMAD_PROXY_REMOTE_IP_CHECK']
|
||||
assert_match(/"remote_ip":"#{ENV['ZAMMAD_PROXY_REMOTE_IP_CHECK']}"/, result.body)
|
||||
|
|
|
@ -65,7 +65,7 @@ class ActiveSupport::TestCase
|
|||
end
|
||||
count = 0
|
||||
lines.reverse_each do |line|
|
||||
break if line.match?(/\+\+\+\+NEW\+\+\+\+TEST\+\+\+\+/)
|
||||
break if line.include?('++++NEW++++TEST++++')
|
||||
next if !line.match?(/Send notification \(#{type}\)/)
|
||||
next if !line.match?(/to:\s#{recipient}/)
|
||||
|
||||
|
|
|
@ -8,18 +8,18 @@ class EmailBuildTest < ActiveSupport::TestCase
|
|||
|
||||
assert(result.start_with?('<!DOCTYPE'), 'test 1')
|
||||
assert(result !~ /^.+?<!DOCTYPE/, 'test 1')
|
||||
assert(result =~ /<html>/, 'test 1')
|
||||
assert(result =~ /font-family/, 'test 1')
|
||||
assert(result =~ %r{<b>test</b>}, 'test 1')
|
||||
assert(result.include?('<html>'), 'test 1')
|
||||
assert(result.include?('font-family'), 'test 1')
|
||||
assert(result.include?('<b>test</b>'), 'test 1')
|
||||
|
||||
html = 'invalid <!DOCTYPE html><html><b>test</b></html>'
|
||||
result = Channel::EmailBuild.html_complete_check(html)
|
||||
|
||||
assert(result !~ /^<!DOCTYPE/, 'test 2')
|
||||
assert(result =~ /^.+?<!DOCTYPE/, 'test 2')
|
||||
assert(result =~ /<html>/, 'test 2')
|
||||
assert(result.include?('<html>'), 'test 2')
|
||||
assert(result !~ /font-family/, 'test 2')
|
||||
assert(result =~ %r{<b>test</b>}, 'test 2')
|
||||
assert(result.include?('<b>test</b>'), 'test 2')
|
||||
|
||||
# Issue #1230, missing backslashes
|
||||
# 'Test URL: \\storage\project\100242-Inc'
|
||||
|
|
Loading…
Reference in a new issue