mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
Update for rubocop 0.85
This commit is contained in:
parent
6662816a5f
commit
384dc86db3
4 changed files with 11 additions and 5 deletions
|
@ -21,6 +21,12 @@ Style/SlicingWithRange:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
Lint/DeprecatedOpenSSLConstant:
|
Lint/DeprecatedOpenSSLConstant:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
Lint/MixedRegexpCaptureTypes:
|
||||||
|
Enabled: true
|
||||||
|
Style/RedundantRegexpCharacterClass:
|
||||||
|
Enabled: true
|
||||||
|
Style/RedundantRegexpEscape:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Layout/LineLength:
|
Layout/LineLength:
|
||||||
Description: 'Limit lines to 80 characters.'
|
Description: 'Limit lines to 80 characters.'
|
||||||
|
|
|
@ -19,5 +19,5 @@ rescue StandardError, RSpec::Expectations::ExpectationNotMetError => e
|
||||||
end
|
end
|
||||||
|
|
||||||
Then(/^the failing exception should be nice$/) do
|
Then(/^the failing exception should be nice$/) do
|
||||||
expect(@error_message).to match(/expected to find css \"h1#doesnotexist\"/)
|
expect(@error_message).to match(/expected to find css "h1#doesnotexist"/)
|
||||||
end
|
end
|
||||||
|
|
|
@ -758,7 +758,7 @@ Capybara::SpecHelper.spec 'node' do
|
||||||
@session.visit('with_js')
|
@session.visit('with_js')
|
||||||
@session.find(:css, '#click-test').click(x: 5, y: 5)
|
@session.find(:css, '#click-test').click(x: 5, y: 5)
|
||||||
link = @session.find(:link, 'has-been-clicked')
|
link = @session.find(:link, 'has-been-clicked')
|
||||||
locations = link.text.match(/^Has been clicked at (?<x>[\d\.-]+),(?<y>[\d\.-]+)$/)
|
locations = link.text.match(/^Has been clicked at (?<x>[\d.-]+),(?<y>[\d.-]+)$/)
|
||||||
# Resulting click location should be very close to 0, 0 relative to top left corner of the element, but may not be exact due to
|
# Resulting click location should be very close to 0, 0 relative to top left corner of the element, but may not be exact due to
|
||||||
# integer/float conversions and rounding.
|
# integer/float conversions and rounding.
|
||||||
expect(locations[:x].to_f).to be_within(1).of(5)
|
expect(locations[:x].to_f).to be_within(1).of(5)
|
||||||
|
@ -884,7 +884,7 @@ Capybara::SpecHelper.spec 'node' do
|
||||||
@session.visit('with_js')
|
@session.visit('with_js')
|
||||||
@session.find(:css, '#click-test').double_click(x: 10, y: 5)
|
@session.find(:css, '#click-test').double_click(x: 10, y: 5)
|
||||||
link = @session.find(:link, 'has-been-double-clicked')
|
link = @session.find(:link, 'has-been-double-clicked')
|
||||||
locations = link.text.match(/^Has been double clicked at (?<x>[\d\.-]+),(?<y>[\d\.-]+)$/)
|
locations = link.text.match(/^Has been double clicked at (?<x>[\d.-]+),(?<y>[\d.-]+)$/)
|
||||||
# Resulting click location should be very close to 10, 5 relative to top left corner of the element, but may not be exact due
|
# Resulting click location should be very close to 10, 5 relative to top left corner of the element, but may not be exact due
|
||||||
# to integer/float conversions and rounding.
|
# to integer/float conversions and rounding.
|
||||||
expect(locations[:x].to_f).to be_within(1).of(10)
|
expect(locations[:x].to_f).to be_within(1).of(10)
|
||||||
|
@ -970,7 +970,7 @@ Capybara::SpecHelper.spec 'node' do
|
||||||
@session.visit('with_js')
|
@session.visit('with_js')
|
||||||
@session.find(:css, '#click-test').right_click(x: 10, y: 10)
|
@session.find(:css, '#click-test').right_click(x: 10, y: 10)
|
||||||
link = @session.find(:link, 'has-been-right-clicked')
|
link = @session.find(:link, 'has-been-right-clicked')
|
||||||
locations = link.text.match(/^Has been right clicked at (?<x>[\d\.-]+),(?<y>[\d\.-]+)$/)
|
locations = link.text.match(/^Has been right clicked at (?<x>[\d.-]+),(?<y>[\d.-]+)$/)
|
||||||
# Resulting click location should be very close to 10, 10 relative to top left corner of the element, but may not be exact due
|
# Resulting click location should be very close to 10, 10 relative to top left corner of the element, but may not be exact due
|
||||||
# to integer/float conversions and rounding
|
# to integer/float conversions and rounding
|
||||||
expect(locations[:x].to_f).to be_within(1).of(10)
|
expect(locations[:x].to_f).to be_within(1).of(10)
|
||||||
|
|
|
@ -606,7 +606,7 @@ RSpec.shared_examples Capybara::RSpecMatchers do |session, _mode|
|
||||||
visit('/with_js')
|
visit('/with_js')
|
||||||
expect do
|
expect do
|
||||||
expect(session).to have_current_path('/not_with_js')
|
expect(session).to have_current_path('/not_with_js')
|
||||||
end.to raise_error(%r{to equal "/not\_with\_js"})
|
end.to raise_error(%r{to equal "/not_with_js"})
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with wait' do
|
context 'with wait' do
|
||||||
|
|
Loading…
Add table
Reference in a new issue