From 1e096ddcc02d09351ee61475e40ed6e8f5e4bca5 Mon Sep 17 00:00:00 2001 From: jgagner Date: Tue, 12 Jan 2010 12:27:39 -0800 Subject: [PATCH] Fixed naming --- lib/capybara/driver/selenium_driver.rb | 2 +- lib/capybara/session.rb | 6 +++++- spec/drivers_spec.rb | 2 +- spec/dsl/{with_frame_spec.rb => within_frame_spec.rb} | 0 spec/views/{with_frames.erb => within_frames.erb} | 0 5 files changed, 7 insertions(+), 3 deletions(-) rename spec/dsl/{with_frame_spec.rb => within_frame_spec.rb} (100%) rename spec/views/{with_frames.erb => within_frames.erb} (100%) diff --git a/lib/capybara/driver/selenium_driver.rb b/lib/capybara/driver/selenium_driver.rb index 076fcc15..d450c629 100644 --- a/lib/capybara/driver/selenium_driver.rb +++ b/lib/capybara/driver/selenium_driver.rb @@ -103,7 +103,7 @@ class Capybara::Driver::Selenium < Capybara::Driver::Base def browser self.class.driver end - def with_frame(frame_id) + def within_frame(frame_id) old_window = browser.window_handle browser.switch_to.frame(frame_id) yield diff --git a/lib/capybara/session.rb b/lib/capybara/session.rb index a82d4347..ba0e6a67 100644 --- a/lib/capybara/session.rb +++ b/lib/capybara/session.rb @@ -8,7 +8,7 @@ module Capybara :all, :attach_file, :body, :check, :choose, :click, :click_button, :click_link, :current_url, :drag, :evaluate_script, :field_labeled, :fill_in, :find, :find_button, :find_by_id, :find_field, :find_link, :has_content?, :has_css?, :has_no_content?, :has_no_css?, :has_no_xpath?, :has_xpath?, :locate, :save_and_open_page, :select, :source, :uncheck, - :visit, :wait_until, :within, :within_fieldset, :within_table + :visit, :wait_until, :within, :within_fieldset, :within_table,:within_frame ] attr_reader :mode, :app @@ -33,6 +33,10 @@ module Capybara end end + def within_frame frame_id + driver.within_frame frame_id + end + def current_url driver.current_url end diff --git a/spec/drivers_spec.rb b/spec/drivers_spec.rb index 8d833609..523be045 100644 --- a/spec/drivers_spec.rb +++ b/spec/drivers_spec.rb @@ -1,7 +1,7 @@ require File.expand_path('spec_helper', File.dirname(__FILE__)) shared_examples_for 'driver with frame support' do - it_should_behave_like 'with_frame' + it_should_behave_like 'within_frame' end shared_examples_for 'driver' do diff --git a/spec/dsl/with_frame_spec.rb b/spec/dsl/within_frame_spec.rb similarity index 100% rename from spec/dsl/with_frame_spec.rb rename to spec/dsl/within_frame_spec.rb diff --git a/spec/views/with_frames.erb b/spec/views/within_frames.erb similarity index 100% rename from spec/views/with_frames.erb rename to spec/views/within_frames.erb