Added current_url to SeleniumSession to have the same api for both sessions

This commit is contained in:
Luke Amdor 2009-05-13 10:26:25 -05:00 committed by Mike Gaffney
parent 77fa1bcdb6
commit 7f13a70b4b
2 changed files with 5 additions and 0 deletions

View File

@ -55,6 +55,10 @@ module Webrat
selenium.get_html_source selenium.get_html_source
end end
def current_url
selenium.location
end
def click_button(button_text_or_regexp = nil, options = {}) def click_button(button_text_or_regexp = nil, options = {})
if button_text_or_regexp.is_a?(Hash) && options == {} if button_text_or_regexp.is_a?(Hash) && options == {}
pattern, options = nil, button_text_or_regexp pattern, options = nil, button_text_or_regexp

View File

@ -10,6 +10,7 @@ class WebratTest < ActionController::IntegrationTest
test "should visit pages" do test "should visit pages" do
visit root_path visit root_path
assert_contain("Webrat Form") assert_contain("Webrat Form")
assert URI.parse(current_url).path, root_path
end end
test "should submit forms" do test "should submit forms" do