Merge commit 'mfilej/master'

This commit is contained in:
Bryan Helmkamp 2008-11-13 21:11:50 -05:00
commit 0a2fc91cbb
2 changed files with 22 additions and 1 deletions

View File

@ -11,7 +11,11 @@ module Webrat
end end
def text def text
@element.inner_text str = @element.inner_text
str.gsub!("\n","")
str.strip!
str.squeeze!(" ")
str
end end
end end

View File

@ -108,4 +108,21 @@ describe "field_labeled" do
with_an_id_of "element_42", :for => "The Label" with_an_id_of "element_42", :for => "The Label"
should_raise_error_matching /Could not find .* "Other Label"/, :for => "Other Label" should_raise_error_matching /Could not find .* "Other Label"/, :for => "Other Label"
end end
describe "finding a field with it's label containing newlines" do
using_this_html <<-HTML
<form>
<label for="element_42">
A label with
<a>a link on it's own line</a>
</label>
<input type="text" id="element_42">
</form>
HTML
should_return_a Webrat::TextField, :for => "A label with a link on it's own line"
with_an_id_of "element_42", :for => "A label with a link on it's own line"
should_raise_error_matching /Could not find .* "Other Label"/, :for => "Other Label"
end
end end