add a link to the rendered text and add a test for clicking it

This commit is contained in:
Amos King 2009-01-13 22:33:47 -06:00
parent 9745673f1c
commit 3902573d3e
2 changed files with 7 additions and 1 deletions

View File

@ -4,7 +4,7 @@ class WebratController < ApplicationController
end end
def submit def submit
render :text => "OK" render :text => "OK <a href='/' id='link_id'>Test Link Text</a>"
end end
def internal_redirect def internal_redirect

View File

@ -23,4 +23,10 @@ class WebratTest < ActionController::IntegrationTest
visit external_redirect_path visit external_redirect_path
assert response.redirect? assert response.redirect?
end end
test "should click link by text" do
visit internal_redirect_path
click_link "Test Link Text"
assert_contain("Webrat Form")
end
end end