1
0
Fork 0
mirror of https://github.com/teamcapybara/capybara.git synced 2022-11-09 12:08:07 -05:00
teamcapybara--capybara/lib/capybara/spec/session/text_spec.rb
Scott Cytacki 17224befe7 Fix document#text
It failed if the default selector was css, and failed with selenium with xpath.  Calling find('.') or find('/') in selenium returns a element that causes errors.  It now calls find(:xpath, '/html') which seems to work everywhere.
2011-02-18 16:29:51 -05:00

19 lines
469 B
Ruby

shared_examples_for "text" do
describe '#text' do
before do
@session.visit('/with_simple_html')
end
it "should print the text of the page" do
@session.text.should == 'Bar'
end
context "with css as default selector" do
before { Capybara.default_selector = :css }
it "should print the text of the page" do
@session.text.should == 'Bar'
end
after { Capybara.default_selector = :xpath }
end
end
end