Просмотр исходного кода

Updated rubocop(-* gems) to latest version (0.83.0).

Thorsten Eckel 4 лет назад
Родитель
Сommit
163dbc4e9e

+ 3 - 5
Gemfile.lock

@@ -255,7 +255,6 @@ GEM
     ice_cube (0.16.3)
     ice_cube (0.16.3)
     inflection (1.0.0)
     inflection (1.0.0)
     interception (0.5)
     interception (0.5)
-    jaro_winkler (1.5.4)
     json (2.3.0)
     json (2.3.0)
     jwt (2.2.1)
     jwt (2.2.1)
     kgio (2.11.2)
     kgio (2.11.2)
@@ -355,7 +354,7 @@ GEM
       omniauth (~> 1.5)
       omniauth (~> 1.5)
       omniauth-oauth2 (>= 1.4.0)
       omniauth-oauth2 (>= 1.4.0)
     parallel (1.19.1)
     parallel (1.19.1)
-    parser (2.7.1.1)
+    parser (2.7.1.2)
       ast (~> 2.4.0)
       ast (~> 2.4.0)
     pg (0.21.0)
     pg (0.21.0)
     pluginator (1.5.0)
     pluginator (1.5.0)
@@ -449,8 +448,7 @@ GEM
       rspec-support (~> 3.8.0)
       rspec-support (~> 3.8.0)
     rspec-support (3.8.0)
     rspec-support (3.8.0)
     rszr (0.5.2)
     rszr (0.5.2)
-    rubocop (0.82.0)
-      jaro_winkler (~> 1.5.1)
+    rubocop (0.83.0)
       parallel (~> 1.10)
       parallel (~> 1.10)
       parser (>= 2.7.0.1)
       parser (>= 2.7.0.1)
       rainbow (>= 2.2.2, < 4.0)
       rainbow (>= 2.2.2, < 4.0)
@@ -463,7 +461,7 @@ GEM
       activesupport
       activesupport
       rack (>= 1.1)
       rack (>= 1.1)
       rubocop (>= 0.72.0)
       rubocop (>= 0.72.0)
-    rubocop-rspec (1.38.1)
+    rubocop-rspec (1.39.0)
       rubocop (>= 0.68.1)
       rubocop (>= 0.68.1)
     ruby-progressbar (1.10.1)
     ruby-progressbar (1.10.1)
     ruby-saml (1.10.2)
     ruby-saml (1.10.2)

+ 2 - 2
app/models/cti/caller_id.rb

@@ -237,9 +237,9 @@ returns
       number.gsub!(/\D/, '')
       number.gsub!(/\D/, '')
       case number
       case number
       when /^00/
       when /^00/
-        number[2..-1]
+        number[2..]
       when /^0/
       when /^0/
-        DEFAULT_COUNTRY_ID + number[1..-1]
+        DEFAULT_COUNTRY_ID + number[1..]
       else
       else
         number
         number
       end
       end

+ 1 - 0
app/models/ticket/article.rb

@@ -46,6 +46,7 @@ class Ticket::Article < ApplicationModel
                              :cc
                              :cc
 
 
   attr_accessor :should_clone_inline_attachments
   attr_accessor :should_clone_inline_attachments
+
   alias should_clone_inline_attachments? should_clone_inline_attachments
   alias should_clone_inline_attachments? should_clone_inline_attachments
 
 
   # fillup md5 of message id to search easier on very long message ids
   # fillup md5 of message id to search easier on very long message ids

+ 4 - 4
spec/system/settings/ticket_spec.rb

@@ -10,18 +10,18 @@ RSpec.describe 'Manage > Settings > Ticket', type: :system do
 
 
       within(:active_content) do
       within(:active_content) do
         click(:href, '#auto_assignment')
         click(:href, '#auto_assignment')
-        expect(page).to have_field('ticket_auto_assignment', checked: false, visible: false)
+        expect(page).to have_field('ticket_auto_assignment', checked: false, visible: :hidden)
         find('.js-ticketAutoAssignment').click
         find('.js-ticketAutoAssignment').click
-        expect(page).to have_field('ticket_auto_assignment', checked: true, visible: false)
+        expect(page).to have_field('ticket_auto_assignment', checked: true, visible: :hidden)
       end
       end
 
 
       refresh
       refresh
 
 
       within(:active_content) do
       within(:active_content) do
         click(:href, '#auto_assignment')
         click(:href, '#auto_assignment')
-        expect(page).to have_field('ticket_auto_assignment', checked: true, visible: false)
+        expect(page).to have_field('ticket_auto_assignment', checked: true, visible: :hidden)
         find('.js-ticketAutoAssignment').click
         find('.js-ticketAutoAssignment').click
-        expect(page).to have_field('ticket_auto_assignment', checked: false, visible: false)
+        expect(page).to have_field('ticket_auto_assignment', checked: false, visible: :hidden)
       end
       end
     end
     end
   end
   end

+ 2 - 2
spec/system/ticket/update_spec.rb

@@ -98,7 +98,7 @@ RSpec.describe 'Ticket Update', type: :system do
         within(:active_content) do
         within(:active_content) do
           expect(page).to have_selector('.js-objectNumber', text: ticket.number)
           expect(page).to have_selector('.js-objectNumber', text: ticket.number)
 
 
-          expect(page).to have_field(attribute.name, with: '', visible: false)
+          expect(page).to have_field(attribute.name, with: '', visible: :hidden)
           expect(page).to have_select('state_id',
           expect(page).to have_select('state_id',
                                       selected: 'new',
                                       selected: 'new',
                                       options:  ['new', 'closed', 'open', 'pending close', 'pending reminder'])
                                       options:  ['new', 'closed', 'open', 'pending close', 'pending reminder'])
@@ -108,7 +108,7 @@ RSpec.describe 'Ticket Update', type: :system do
           expect(page).not_to have_css('.js-submitDropdown .js-submit[disabled]', wait: 2)
           expect(page).not_to have_css('.js-submitDropdown .js-submit[disabled]', wait: 2)
         end
         end
 
 
-        expect(page).to have_field(attribute.name, with: attribute_value, visible: false)
+        expect(page).to have_field(attribute.name, with: attribute_value, visible: :hidden)
         expect(page).to have_select('state_id',
         expect(page).to have_select('state_id',
                                     selected: 'closed',
                                     selected: 'closed',
                                     options:  ['closed', 'open', 'pending close', 'pending reminder'])
                                     options:  ['closed', 'open', 'pending close', 'pending reminder'])

+ 3 - 3
spec/system/ticket/view_spec.rb

@@ -41,7 +41,7 @@ RSpec.describe 'Ticket views', type: :system do
       # move a bit to the left to display macro batches
       # move a bit to the left to display macro batches
       move_mouse_by(-250, 0)
       move_mouse_by(-250, 0)
 
 
-      expect(page).to have_selector(:macro_batch, macro_without_group.id, visible: true)
+      expect(page).to have_selector(:macro_batch, macro_without_group.id, visible: :visible)
       expect(page).to have_no_selector(:macro_batch, macro_group1.id)
       expect(page).to have_no_selector(:macro_batch, macro_group1.id)
       expect(page).to have_no_selector(:macro_batch, macro_group2.id)
       expect(page).to have_no_selector(:macro_batch, macro_group2.id)
 
 
@@ -60,7 +60,7 @@ RSpec.describe 'Ticket views', type: :system do
       # move a bit to the left to display macro batches
       # move a bit to the left to display macro batches
       move_mouse_by(-250, 0)
       move_mouse_by(-250, 0)
 
 
-      expect(page).to have_selector(:macro_batch, macro_without_group.id, visible: true)
+      expect(page).to have_selector(:macro_batch, macro_without_group.id, visible: :visible)
       expect(page).to have_selector(:macro_batch, macro_group1.id)
       expect(page).to have_selector(:macro_batch, macro_group1.id)
       expect(page).to have_no_selector(:macro_batch, macro_group2.id)
       expect(page).to have_no_selector(:macro_batch, macro_group2.id)
 
 
@@ -79,7 +79,7 @@ RSpec.describe 'Ticket views', type: :system do
       # move a bit to the left to display macro batches
       # move a bit to the left to display macro batches
       move_mouse_by(-250, 0)
       move_mouse_by(-250, 0)
 
 
-      expect(page).to have_selector(:macro_batch, macro_without_group.id, visible: true)
+      expect(page).to have_selector(:macro_batch, macro_without_group.id, visible: :visible)
       expect(page).to have_no_selector(:macro_batch, macro_group1.id)
       expect(page).to have_no_selector(:macro_batch, macro_group1.id)
       expect(page).to have_selector(:macro_batch, macro_group2.id)
       expect(page).to have_selector(:macro_batch, macro_group2.id)