mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
add driver specs that make sure body responses are set to the correct encoding with html entities for ruby 1.9
This commit is contained in:
parent
b382a0e769
commit
16eef3a6d8
2 changed files with 15 additions and 0 deletions
|
@ -26,6 +26,20 @@ shared_examples_for 'driver' do
|
|||
@driver.visit('/with_simple_html')
|
||||
@driver.body.should include('Bar')
|
||||
end
|
||||
|
||||
if "".respond_to?(:encoding)
|
||||
context "encoding of response between ascii and utf8" do
|
||||
it "should be valid with html entities" do
|
||||
@driver.visit('/with_html_entities')
|
||||
lambda { @driver.body.encode!("UTF-8") }.should_not raise_error
|
||||
end
|
||||
|
||||
it "should be valid without html entities" do
|
||||
@driver.visit('/with_html')
|
||||
lambda { @driver.body.encode!("UTF-8") }.should_not raise_error
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe '#find' do
|
||||
|
|
1
lib/capybara/spec/views/with_html_entities.erb
Normal file
1
lib/capybara/spec/views/with_html_entities.erb
Normal file
|
@ -0,0 +1 @@
|
|||
Encoding with — html entities »
|
Loading…
Reference in a new issue