mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
Do not add additional carriage returns to CR+LF in textareas with rack_test
This commit is contained in:
parent
98e367d9f9
commit
9122dd108f
2 changed files with 7 additions and 1 deletions
|
@ -120,7 +120,7 @@ private
|
||||||
end
|
end
|
||||||
|
|
||||||
def add_textarea_param(field, params)
|
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
|
end
|
||||||
|
|
||||||
def submitter?(el)
|
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")
|
expect(extract_results(@session)['description']).to eq("\r\nSome text\r\n")
|
||||||
end
|
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
|
it 'should fill in a color field' do
|
||||||
@session.fill_in('Html5 Color', with: '#112233')
|
@session.fill_in('Html5 Color', with: '#112233')
|
||||||
@session.click_button('html5_submit')
|
@session.click_button('html5_submit')
|
||||||
|
|
Loading…
Add table
Reference in a new issue