File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55# Ported from https://github.com/teamcapybara/capybara/blob/3.40.0/spec/shared_selenium_session.rb
66RSpec . describe 'fill_in options' , sinatra : true do
77 before do
8+ # Ignore older versions without `#active_element` definition.
9+ skip if Gem ::Version . new ( Capybara ::VERSION ) < Gem ::Version . new ( '3.36.0' )
10+
811 sinatra . get '/' do
912 <<~HTML
1013 <!DOCTYPE html>
7275 end
7376
7477 it 'should fill in if the option is set via global option' do
75- Capybara . default_set_options = { clear : :backspace }
76- visit '/'
77- fill_in ( 'form_first_name' , with : 'Thomas' )
78- expect ( find ( :fillable_field , 'form_first_name' ) . value ) . to eq ( 'Thomas' )
79- ensure
80- Capybara . default_set_options = { }
78+ begin
79+ Capybara . default_set_options = { clear : :backspace }
80+ visit '/'
81+ fill_in ( 'form_first_name' , with : 'Thomas' )
82+ expect ( find ( :fillable_field , 'form_first_name' ) . value ) . to eq ( 'Thomas' )
83+ ensure
84+ Capybara . default_set_options = { }
85+ end
8186 end
8287
8388 it 'should only trigger onchange once' do
You can’t perform that action at this time.
0 commit comments