1
0
Fork 0
mirror of https://github.com/teamcapybara/capybara.git synced 2022-11-09 12:08:07 -05:00

Prepare for next rubocop-rspec release

This commit is contained in:
Thomas Walpole 2020-05-10 16:31:37 -07:00
parent b4dbf6473a
commit 993ef0e832
3 changed files with 8 additions and 8 deletions

View file

@ -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

View file

@ -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

View file

@ -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