From c9494968cc40fa40def130062b12e85c72a0158e Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Wed, 5 Nov 2008 18:30:14 -0500 Subject: [PATCH] Renaming clicks_area to click_area --- lib/webrat/core/scope.rb | 4 ++-- spec/api/click_area_spec.rb | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/webrat/core/scope.rb b/lib/webrat/core/scope.rb index d1606d5..e990df0 100644 --- a/lib/webrat/core/scope.rb +++ b/lib/webrat/core/scope.rb @@ -93,11 +93,11 @@ module Webrat alias_method :attach_file, :attaches_file - def clicks_area(area_name) + def click_area(area_name) find_area(area_name).click end - alias_method :click_area, :clicks_area + alias_method :clicks_area, :click_area # Issues a request for the URL pointed to by a link on the current page, # follows any redirects, and verifies the final page load was successful. diff --git a/spec/api/click_area_spec.rb b/spec/api/click_area_spec.rb index 550f333..8de3bf1 100644 --- a/spec/api/click_area_spec.rb +++ b/spec/api/click_area_spec.rb @@ -1,6 +1,6 @@ require File.expand_path(File.dirname(__FILE__) + "/../spec_helper") -describe "clicks_area" do +describe "click_area" do before do @session = Webrat::TestSession.new end @@ -12,7 +12,7 @@ describe "clicks_area" do EOS @session.should_receive(:get).with("/page", {}) - @session.clicks_area "Berlin" + @session.click_area "Berlin" end it "should assert valid response" do @@ -22,7 +22,7 @@ describe "clicks_area" do EOS @session.response_code = 501 - lambda { @session.clicks_area "Berlin" }.should raise_error + lambda { @session.click_area "Berlin" }.should raise_error end [200, 300, 400, 499].each do |status| @@ -33,7 +33,7 @@ describe "clicks_area" do EOS @session.response_code = status - lambda { @session.clicks_area "Berlin" }.should_not raise_error + lambda { @session.click_area "Berlin" }.should_not raise_error end end @@ -45,7 +45,7 @@ describe "clicks_area" do EOS lambda { - @session.clicks_area "Missing area" + @session.click_area "Missing area" }.should raise_error end @@ -56,7 +56,7 @@ describe "clicks_area" do EOS @session.should_receive(:get).with("/page", {}) - @session.clicks_area "berlin" + @session.click_area "berlin" end @@ -68,7 +68,7 @@ describe "clicks_area" do EOS @session.should_receive(:get).with("/page/sub", {}) - @session.clicks_area "Berlin" + @session.click_area "Berlin" end it "should follow fully qualified local links" do @@ -78,7 +78,7 @@ describe "clicks_area" do EOS @session.should_receive(:get).with("http://www.example.com/page", {}) - @session.clicks_area "Berlin" + @session.click_area "Berlin" end it "should follow query parameters" do @@ -88,6 +88,6 @@ describe "clicks_area" do EOS @session.should_receive(:get).with("/page?foo=bar", {}) - @session.clicks_area "Berlin" + @session.click_area "Berlin" end end