mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
268b7caf32
The latter has timing issues in Selenium, since visit/click_link, etc are async even on regular page reloads.
21 lines
723 B
Ruby
21 lines
723 B
Ruby
Capybara::SpecHelper.spec '#body' do
|
|
it "should return the unmodified page body" do
|
|
@session.visit('/')
|
|
@session.should have_content('Hello world!') # wait for content to appear if visit is async
|
|
@session.body.should include('Hello world!')
|
|
end
|
|
|
|
if "".respond_to?(:encoding)
|
|
context "encoding of response between ascii and utf8" do
|
|
it "should be valid with html entities" do
|
|
@session.visit('/with_html_entities')
|
|
lambda { @session.body.encode!("UTF-8") }.should_not raise_error
|
|
end
|
|
|
|
it "should be valid without html entities" do
|
|
@session.visit('/with_html')
|
|
lambda { @session.body.encode!("UTF-8") }.should_not raise_error
|
|
end
|
|
end
|
|
end
|
|
end
|