Renaming clicks_area to click_area

This commit is contained in:
Bryan Helmkamp 2008-11-05 18:30:14 -05:00
parent c5bf4f30f6
commit c9494968cc
2 changed files with 11 additions and 11 deletions

View File

@ -93,11 +93,11 @@ module Webrat
alias_method :attach_file, :attaches_file alias_method :attach_file, :attaches_file
def clicks_area(area_name) def click_area(area_name)
find_area(area_name).click find_area(area_name).click
end 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, # 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. # follows any redirects, and verifies the final page load was successful.

View File

@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + "/../spec_helper") require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")
describe "clicks_area" do describe "click_area" do
before do before do
@session = Webrat::TestSession.new @session = Webrat::TestSession.new
end end
@ -12,7 +12,7 @@ describe "clicks_area" do
</map> </map>
EOS EOS
@session.should_receive(:get).with("/page", {}) @session.should_receive(:get).with("/page", {})
@session.clicks_area "Berlin" @session.click_area "Berlin"
end end
it "should assert valid response" do it "should assert valid response" do
@ -22,7 +22,7 @@ describe "clicks_area" do
</map> </map>
EOS EOS
@session.response_code = 501 @session.response_code = 501
lambda { @session.clicks_area "Berlin" }.should raise_error lambda { @session.click_area "Berlin" }.should raise_error
end end
[200, 300, 400, 499].each do |status| [200, 300, 400, 499].each do |status|
@ -33,7 +33,7 @@ describe "clicks_area" do
</map> </map>
EOS EOS
@session.response_code = status @session.response_code = status
lambda { @session.clicks_area "Berlin" }.should_not raise_error lambda { @session.click_area "Berlin" }.should_not raise_error
end end
end end
@ -45,7 +45,7 @@ describe "clicks_area" do
EOS EOS
lambda { lambda {
@session.clicks_area "Missing area" @session.click_area "Missing area"
}.should raise_error }.should raise_error
end end
@ -56,7 +56,7 @@ describe "clicks_area" do
</map> </map>
EOS EOS
@session.should_receive(:get).with("/page", {}) @session.should_receive(:get).with("/page", {})
@session.clicks_area "berlin" @session.click_area "berlin"
end end
@ -68,7 +68,7 @@ describe "clicks_area" do
</map> </map>
EOS EOS
@session.should_receive(:get).with("/page/sub", {}) @session.should_receive(:get).with("/page/sub", {})
@session.clicks_area "Berlin" @session.click_area "Berlin"
end end
it "should follow fully qualified local links" do it "should follow fully qualified local links" do
@ -78,7 +78,7 @@ describe "clicks_area" do
</map> </map>
EOS EOS
@session.should_receive(:get).with("http://www.example.com/page", {}) @session.should_receive(:get).with("http://www.example.com/page", {})
@session.clicks_area "Berlin" @session.click_area "Berlin"
end end
it "should follow query parameters" do it "should follow query parameters" do
@ -88,6 +88,6 @@ describe "clicks_area" do
</map> </map>
EOS EOS
@session.should_receive(:get).with("/page?foo=bar", {}) @session.should_receive(:get).with("/page?foo=bar", {})
@session.clicks_area "Berlin" @session.click_area "Berlin"
end end
end end