From 7f13a70b4bb497aede72209898876dd42c2a0714 Mon Sep 17 00:00:00 2001 From: Luke Amdor Date: Wed, 13 May 2009 10:26:25 -0500 Subject: [PATCH] Added current_url to SeleniumSession to have the same api for both sessions --- lib/webrat/selenium/selenium_session.rb | 4 ++++ spec/integration/rails/test/integration/webrat_test.rb | 1 + 2 files changed, 5 insertions(+) diff --git a/lib/webrat/selenium/selenium_session.rb b/lib/webrat/selenium/selenium_session.rb index 5149299..bd860a5 100644 --- a/lib/webrat/selenium/selenium_session.rb +++ b/lib/webrat/selenium/selenium_session.rb @@ -55,6 +55,10 @@ module Webrat selenium.get_html_source end + def current_url + selenium.location + end + def click_button(button_text_or_regexp = nil, options = {}) if button_text_or_regexp.is_a?(Hash) && options == {} pattern, options = nil, button_text_or_regexp diff --git a/spec/integration/rails/test/integration/webrat_test.rb b/spec/integration/rails/test/integration/webrat_test.rb index e2c2def..b1449ca 100644 --- a/spec/integration/rails/test/integration/webrat_test.rb +++ b/spec/integration/rails/test/integration/webrat_test.rb @@ -10,6 +10,7 @@ class WebratTest < ActionController::IntegrationTest test "should visit pages" do visit root_path assert_contain("Webrat Form") + assert URI.parse(current_url).path, root_path end test "should submit forms" do