mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
Merge pull request #2547 from adigi-ai/fix-carriage-returns-in-rack-test
Rack-test driver adds additional carriage return to CR+LF in textareas
This commit is contained in:
commit
270f7b4f71
2 changed files with 7 additions and 1 deletions
|
@ -120,7 +120,7 @@ private
|
|||
end
|
||||
|
||||
def add_textarea_param(field, params)
|
||||
merge_param!(params, field['name'], field['_capybara_raw_value'].to_s.gsub(/\n/, "\r\n"))
|
||||
merge_param!(params, field['name'], field['_capybara_raw_value'].to_s.gsub(/\r?\n/, "\r\n"))
|
||||
end
|
||||
|
||||
def submitter?(el)
|
||||
|
|
|
@ -98,6 +98,12 @@ Capybara::SpecHelper.spec '#fill_in' do
|
|||
expect(extract_results(@session)['description']).to eq("\r\nSome text\r\n")
|
||||
end
|
||||
|
||||
it 'should handle carriage returns with line feeds in a textarea correct' do
|
||||
@session.fill_in('form_description', with: "\r\nSome text\r\n")
|
||||
@session.click_button('awesome')
|
||||
expect(extract_results(@session)['description']).to eq("\r\nSome text\r\n")
|
||||
end
|
||||
|
||||
it 'should fill in a color field' do
|
||||
@session.fill_in('Html5 Color', with: '#112233')
|
||||
@session.click_button('html5_submit')
|
||||
|
|
Loading…
Reference in a new issue