From 993ef0e832fd59da088777e3c97dbad90c81ba06 Mon Sep 17 00:00:00 2001 From: Thomas Walpole Date: Sun, 10 May 2020 16:31:37 -0700 Subject: [PATCH] Prepare for next rubocop-rspec release --- lib/capybara/spec/session/has_select_spec.rb | 8 ++++---- lib/capybara/spec/session/node_spec.rb | 4 ++-- spec/rspec/shared_spec_matchers.rb | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/capybara/spec/session/has_select_spec.rb b/lib/capybara/spec/session/has_select_spec.rb index 8e47c1d1..fbc2aa6d 100644 --- a/lib/capybara/spec/session/has_select_spec.rb +++ b/lib/capybara/spec/session/has_select_spec.rb @@ -63,7 +63,7 @@ Capybara::SpecHelper.spec '#has_select?' do end it "should be true even when the selected option invisible, regardless of the select's visibility" do - expect(@session).to have_select('Icecream', visible: false, selected: 'Chocolate') + expect(@session).to have_select('Icecream', visible: :hidden, selected: 'Chocolate') expect(@session).to have_select('Sorbet', selected: 'Vanilla') end end @@ -88,7 +88,7 @@ Capybara::SpecHelper.spec '#has_select?' do end it "should be true even when the selected values are invisible, regardless of the select's visibility" do - expect(@session).to have_select('Dessert', visible: false, with_options: %w[Pudding Tiramisu]) + expect(@session).to have_select('Dessert', visible: :hidden, with_options: %w[Pudding Tiramisu]) expect(@session).to have_select('Cake', with_selected: ['Chocolate Cake', 'Sponge Cake']) end @@ -113,7 +113,7 @@ Capybara::SpecHelper.spec '#has_select?' do end it 'should be true even when the options are invisible, if the select itself is invisible' do - expect(@session).to have_select('Icecream', visible: false, options: %w[Chocolate Vanilla Strawberry]) + expect(@session).to have_select('Icecream', visible: :hidden, options: %w[Chocolate Vanilla Strawberry]) end end @@ -158,7 +158,7 @@ Capybara::SpecHelper.spec '#has_select?' do end it 'should be true even when the options are invisible, if the select itself is invisible' do - expect(@session).to have_select('Icecream', visible: false, with_options: %w[Vanilla Strawberry]) + expect(@session).to have_select('Icecream', visible: :hidden, with_options: %w[Vanilla Strawberry]) end end diff --git a/lib/capybara/spec/session/node_spec.rb b/lib/capybara/spec/session/node_spec.rb index b3eee684..be449e63 100644 --- a/lib/capybara/spec/session/node_spec.rb +++ b/lib/capybara/spec/session/node_spec.rb @@ -271,12 +271,12 @@ Capybara::SpecHelper.spec 'node' do it 'works when details is toggled open and closed' do @session.find(:css, '#closed_details > summary').click - expect(@session).to have_css('#closed_details *', visible: true, count: 5) + expect(@session).to have_css('#closed_details *', visible: :visible, count: 5) .and(have_no_css('#closed_details *', visible: :hidden)) @session.find(:css, '#closed_details > summary').click descendants_css = '#closed_details > *:not(summary), #closed_details > *:not(summary) *' - expect(@session).to have_no_css(descendants_css, visible: true) + expect(@session).to have_no_css(descendants_css, visible: :visible) .and(have_css(descendants_css, visible: :hidden, count: 3)) end end diff --git a/spec/rspec/shared_spec_matchers.rb b/spec/rspec/shared_spec_matchers.rb index 57c5924c..064e467c 100644 --- a/spec/rspec/shared_spec_matchers.rb +++ b/spec/rspec/shared_spec_matchers.rb @@ -840,10 +840,10 @@ RSpec.shared_examples Capybara::RSpecMatchers do |session, _mode| end it 'gives proper description when :visible option passed' do - expect(have_table('Lovely table', visible: true).description).to eq('have visible table "Lovely table"') + expect(have_table('Lovely table', visible: true).description).to eq('have visible table "Lovely table"') # _rubocop:disable Capybara/VisibilityMatcher expect(have_table('Lovely table', visible: :hidden).description).to eq('have non-visible table "Lovely table"') expect(have_table('Lovely table', visible: :all).description).to eq('have table "Lovely table"') - expect(have_table('Lovely table', visible: false).description).to eq('have table "Lovely table"') + expect(have_table('Lovely table', visible: false).description).to eq('have table "Lovely table"') # _rubocop:disable Capybara/VisibilityMatcher end it 'passes if there is such a table' do