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

Maintenance: Update dependency rubocop-rspec to v2.12.1

Martin Gruner 2 лет назад
Родитель
Сommit
eec281c586

+ 2 - 2
Gemfile.lock

@@ -482,8 +482,8 @@ GEM
       activesupport (>= 4.2.0)
       rack (>= 1.1)
       rubocop (>= 1.7.0, < 2.0)
-    rubocop-rspec (2.11.1)
-      rubocop (~> 1.19)
+    rubocop-rspec (2.12.1)
+      rubocop (~> 1.31)
     ruby-progressbar (1.11.0)
     ruby-saml (1.14.0)
       nokogiri (>= 1.10.5)

+ 1 - 1
spec/system/form_spec.rb

@@ -56,7 +56,7 @@ RSpec.describe 'Form', type: :system, authenticated_as: true do
 
         click_on 'Submit'
 
-        expect(page).to have_selector('.has-error [name=email]').and have_no_selector('button[type="submit"][disabled]')
+        expect(page).to have_selector('.has-error [name=email]').and have_no_button(type: 'submit', disabled: true)
       end
     end
   end

+ 7 - 7
spec/system/knowledge_base/locale/answer/edit_spec.rb

@@ -37,25 +37,25 @@ RSpec.describe 'Knowledge Base Locale Answer Edit', type: :system do
     it 'allows mailto links' do
       open_editor_and_add_link 'mailto:test@example.com'
 
-      expect(page).to have_selector('a[href="mailto:test@example.com"]')
+      expect(page).to have_link(href: 'mailto:test@example.com')
     end
 
     it 'allows link with a protocol' do
       open_editor_and_add_link 'protocol://example.org'
 
-      expect(page).to have_selector('a[href="protocol://example.org"]')
+      expect(page).to have_link(href: 'protocol://example.org')
     end
 
     it 'allows relative link' do
       open_editor_and_add_link '/path'
 
-      expect(page).to have_selector('a[href="/path"]')
+      expect(page).to have_link(href: '/path')
     end
 
     it 'allows non-protocol URL and prepends default protocol' do
       open_editor_and_add_link 'example.com'
 
-      expect(page).to have_selector('a[href="http://example.com"]')
+      expect(page).to have_link(href: 'http://example.com')
     end
   end
 
@@ -100,7 +100,7 @@ RSpec.describe 'Knowledge Base Locale Answer Edit', type: :system do
         elem.send_keys :return
 
         wait.until_exists { published_answer_with_tag.reload.tag_list.include? new_tag_name }
-        expect(page).to have_css('a.js-tag', text: new_tag_name)
+        expect(page).to have_link(new_tag_name, href: false, class: ['js-tag'])
       end
     end
 
@@ -116,7 +116,7 @@ RSpec.describe 'Knowledge Base Locale Answer Edit', type: :system do
 
     it 'shows an existing tag' do
       within :active_content do
-        expect(page).to have_css('a.js-tag', text: published_answer_tag_name)
+        expect(page).to have_link(published_answer_tag_name, href: false, class: ['js-tag'])
       end
     end
 
@@ -125,7 +125,7 @@ RSpec.describe 'Knowledge Base Locale Answer Edit', type: :system do
         find('.list-item', text: published_answer_tag_name)
           .find('.js-delete').click
 
-        expect(page).to have_no_css('a.js-tag', text: published_answer_tag_name)
+        expect(page).to have_no_link(published_answer_tag_name, href: false, class: ['js-tag'])
         wait.until_exists { published_answer_with_tag.reload.tag_list.exclude? published_answer_tag_name }
       end
     end

+ 1 - 1
spec/system/knowledge_base/locale/answer/read_spec.rb

@@ -20,7 +20,7 @@ RSpec.describe 'Knowledge Base Locale Answer Read', type: :system, authenticated
       it 'shows tag' do
         within :active_content do
           within '.knowledge-base-article-tags--container' do
-            expect(page).to have_css('a', text: published_answer_tag_name)
+            expect(page).to have_link(published_answer_tag_name)
           end
         end
       end

+ 2 - 2
spec/system/knowledge_base_public/tag_spec.rb

@@ -17,11 +17,11 @@ RSpec.describe 'Public Knowledge Base tag', type: :system, authenticated_as: fal
     end
 
     it 'lists an answer with the tag' do
-      expect(page).to have_css('a', text: published_answer_with_tag.translations.first.title)
+      expect(page).to have_link(published_answer_with_tag.translations.first.title)
     end
 
     it 'does not list another answer' do
-      expect(page).to have_no_css('a', text: published_answer.translations.first.title)
+      expect(page).to have_no_link(published_answer.translations.first.title)
     end
 
     it 'does not show empty placeholder' do

+ 1 - 1
spec/system/setup/first_steps_spec.rb

@@ -75,6 +75,6 @@ RSpec.describe 'First Steps', type: :system do
       click '.tab[data-area="first-steps-widgets"]'
     end
 
-    expect(page).to have_selector 'a[href="#channels/form"].todo.is-done'
+    expect(page).to have_link(href: '#channels/form', class: %w[todo is-done])
   end
 end

+ 1 - 1
spec/system/ticket/create_spec.rb

@@ -17,7 +17,7 @@ RSpec.describe 'Ticket Create', type: :system do
       visit 'ticket/create'
 
       use_template(template)
-      expect(page).to have_no_selector 'select[name="group_id"]'
+      expect(page).to have_no_select('group_id')
     end
   end
 

+ 1 - 1
spec/system/ticket/zoom_spec.rb

@@ -2794,7 +2794,7 @@ RSpec.describe 'Ticket zoom', type: :system do
         end
 
         within_window switch_to_window_index(2) do
-          expect(page).to have_css('a.logo')
+          expect(page).to have_link(class: ['logo'])
         end
         close_window_index(2)
       end