Some new rubocop checks.

This commit is contained in:
Martin Edenhofer 2015-04-27 21:24:14 +02:00
parent 7ff5568b37
commit 03b47edd43
14 changed files with 64 additions and 56 deletions

View file

@ -8,6 +8,11 @@ AllCops:
# https://github.com/bbatsov/rubocop#includingexcluding-files
Metrics/LineLength:
Description: 'Limit lines to 80 characters.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
Enabled: false
Style/NegatedIf:
Description: >-
Favor unless over if for negative conditions

View file

@ -41,7 +41,7 @@ class ActivityStreamTest < ActiveSupport::TestCase
sender_id: Ticket::Article::Sender.lookup( name: 'Customer' ).id,
from: 'Unit Test <unittest@example.com>',
body: 'Unit Test 123',
internal: false
internal: false,
},
},
update: {
@ -85,9 +85,6 @@ class ActivityStreamTest < ActiveSupport::TestCase
tickets = []
tests.each { |test|
ticket = nil
article = nil
ticket = Ticket.create( test[:create][:ticket] )
test[:check][0][:o_id] = ticket.id
test[:check][2][:o_id] = ticket.id
@ -378,7 +375,7 @@ class ActivityStreamTest < ActiveSupport::TestCase
activity_stream_list.each { |item|
check_list += 1
next if check_list != check_count
# next if match
#next if match
#puts '--------'
#puts item.inspect
#puts check_item.inspect

View file

@ -34,7 +34,7 @@ if user
active: true,
)
else
user = User.create_if_not_exists(
User.create_if_not_exists(
login: 'nicole.braun@zammad.org',
firstname: 'Nicole',
lastname: 'Braun',

View file

@ -1,4 +1,5 @@
# encoding: utf-8
# rubocop:disable all
require 'test_helper'
class EmailParserTest < ActiveSupport::TestCase

View file

@ -1,4 +1,5 @@
# encoding: utf-8
# rubocop:disable all
require 'test_helper'
class EmailProcessTest < ActiveSupport::TestCase

View file

@ -1,4 +1,5 @@
# encoding: utf-8
# rubocop:disable PerceivedComplexity, CyclomaticComplexity
require 'test_helper'
class HistoryTest < ActiveSupport::TestCase
@ -27,7 +28,7 @@ class HistoryTest < ActiveSupport::TestCase
sender_id: Ticket::Article::Sender.lookup( name: 'Customer' ).id,
from: 'Unit Test <unittest@example.com>',
body: 'Unit Test 123',
internal: false
internal: false,
},
},
ticket_update: {
@ -94,7 +95,7 @@ class HistoryTest < ActiveSupport::TestCase
sender_id: Ticket::Article::Sender.lookup(name: 'Customer' ).id,
from: 'Unit Test <unittest@example.com>',
body: 'Unit Test 123',
internal: false
internal: false,
},
},
ticket_update: {
@ -213,9 +214,10 @@ class HistoryTest < ActiveSupport::TestCase
user: {
firstname: 'Bob',
lastname: 'Master',
email: 'master@example.com', },
email: 'master@example.com',
active: false,
},
},
history_check: [
{
result: true,
@ -354,16 +356,10 @@ class HistoryTest < ActiveSupport::TestCase
end
def history_check( history_list, history_check )
# puts history_list.inspect
history_check.each { |check_item|
# puts '+++++++++++'
# puts check_item.inspect
match = false
history_list.each { |history_item|
next if match
# puts '--------'
# puts history_item.inspect
# puts history_item.history_object.name
next if history_item['object'] != check_item[:history_object]
next if history_item['type'] != check_item[:history_type]
if check_item[:history_attribute]

View file

@ -1,4 +1,5 @@
# encoding: utf-8
# rubocop:disable Next, UselessAssignment, BlockNesting
require 'test_helper'
class OnlineNotificationTest < ActiveSupport::TestCase

View file

@ -1,4 +1,5 @@
# encoding: utf-8
# rubocop:disable Next, UselessAssignment
require 'test_helper'
class PackageTest < ActiveSupport::TestCase

View file

@ -1,4 +1,5 @@
# encoding: utf-8
# rubocop:disable UselessAssignment
require 'test_helper'
class RestTest < ActiveSupport::TestCase
@ -239,6 +240,6 @@ class RestTest < ActiveSupport::TestCase
#puts 'URL: ' + url
#puts response.code.to_s
#puts response.body.to_s
return { data: response.data, response: response }
{ data: response.data, response: response }
end
end

View file

@ -1,4 +1,5 @@
# encoding: utf-8
# rubocop:disable UselessAssignment
require 'test_helper'
class SessionBasicTest < ActiveSupport::TestCase

View file

@ -1,4 +1,5 @@
# encoding: utf-8
# rubocop:disable UselessAssignment
require 'test_helper'
class SessionBasicTicketTest < ActiveSupport::TestCase

View file

@ -1,4 +1,5 @@
# encoding: utf-8
# rubocop:disable Next, CyclomaticComplexity
require 'test_helper'
class SessionCollectionsTest < ActiveSupport::TestCase

View file

@ -1,4 +1,5 @@
# encoding: utf-8
# rubocop:disable Next, UselessAssignment
require 'test_helper'
class SessionEnhancedTest < ActiveSupport::TestCase

View file

@ -1,4 +1,5 @@
# encoding: utf-8
# rubocop:disable Next
require 'test_helper'
class TokenTest < ActiveSupport::TestCase