mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
060fc3a72d
Previously Rack::Test's #text method might have returned " some text ", whereas now it returns "some text", just like Selenium.
24 lines
730 B
Ruby
24 lines
730 B
Ruby
shared_examples_for "text" do
|
|
describe '#text' do
|
|
it "should print the text of the page" do
|
|
@session.visit('/with_simple_html')
|
|
@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.visit('/with_simple_html')
|
|
@session.text.should == 'Bar'
|
|
end
|
|
after { Capybara.default_selector = :xpath }
|
|
end
|
|
|
|
it "should strip whitespace" do
|
|
@session.visit('/with_html')
|
|
n = @session.find(:css, '#second')
|
|
@session.find(:css, '#second').text.should =~ \
|
|
/\ADuis aute .* text with whitespace .* est laborum\.\z/
|
|
end
|
|
end
|
|
end
|