Skip to content

Commit

Permalink
Renaming clicks_button to click_button
Browse files Browse the repository at this point in the history
  • Loading branch information
brynary committed Nov 5, 2008
1 parent c949496 commit f1bf101
Show file tree
Hide file tree
Showing 11 changed files with 77 additions and 77 deletions.
2 changes: 1 addition & 1 deletion TODO.txt
Expand Up @@ -2,6 +2,6 @@ Fix #within scoping for forms that exist outside the scope
Figure out what the deal is with #select not working
Restore SSL support for Rails (See 73d3b72108254c0f1ad00e63f8e712115cc8ca7c)
Full support for multiple forms on a page
Track the current form based on the location of the last manipulated input, use this as a default for clicks_button
Track the current form based on the location of the last manipulated input, use this as a default for click_button
Make current_url work with redirections
Support for a hash mapping page names to page URLs
8 changes: 4 additions & 4 deletions lib/webrat/core/scope.rb
Expand Up @@ -127,16 +127,16 @@ def click_link(link_text, options = {})
# any redirects, and verifies the final page was successful.
#
# Example:
# clicks_button "Login"
# clicks_button
# click_button "Login"
# click_button
#
# The URL and HTTP method for the form submission are automatically read from the
# <tt>action</tt> and <tt>method</tt> attributes of the <tt><form></tt> element.
def clicks_button(value = nil)
def click_button(value = nil)
find_button(value).click
end

alias_method :click_button, :clicks_button
alias_method :clicks_button, :click_button

def dom # :nodoc:
@dom ||= Hpricot(scoped_html)
Expand Down
2 changes: 1 addition & 1 deletion spec/api/basic_auth_spec.rb
Expand Up @@ -18,6 +18,6 @@
</form>
EOS
@session.should_receive(:post).with("/form1", {}, {'HTTP_AUTHORIZATION' => "Basic dXNlcjpzZWNyZXQ=\n"})
@session.clicks_button
@session.click_button
end
end
10 changes: 5 additions & 5 deletions spec/api/check_spec.rb
Expand Up @@ -35,7 +35,7 @@
EOS
@session.should_receive(:get).with("/login", "user" => {"tos" => "1"})
@session.check "TOS"
@session.clicks_button
@session.click_button
end

it "should result in the value on being posted if not specified" do
Expand All @@ -47,7 +47,7 @@
EOS
@session.should_receive(:post).with("/login", "remember_me" => "on")
@session.check "remember_me"
@session.clicks_button
@session.click_button
end

it "should fail if the checkbox is disabled" do
Expand All @@ -69,7 +69,7 @@
EOS
@session.should_receive(:post).with("/login", "remember_me" => "yes")
@session.check "remember_me"
@session.clicks_button
@session.click_button
end
end

Expand Down Expand Up @@ -119,7 +119,7 @@
@session.should_receive(:get).with("/login", "user" => {"tos" => "0"})
@session.check "TOS"
@session.uncheck "TOS"
@session.clicks_button
@session.click_button
end

it "should result in value not being posted" do
Expand All @@ -131,6 +131,6 @@
EOS
@session.should_receive(:post).with("/login", {})
@session.uncheck "remember_me"
@session.clicks_button
@session.click_button
end
end
10 changes: 5 additions & 5 deletions spec/api/choose_spec.rb
Expand Up @@ -36,7 +36,7 @@
EOS
@session.should_receive(:get).with("/login", "user" => {"gender" => "M"})
@session.choose "Male"
@session.clicks_button
@session.click_button
end

it "should only submit last chosen value" do
Expand All @@ -52,7 +52,7 @@
@session.should_receive(:get).with("/login", "user" => {"gender" => "M"})
@session.choose "Female"
@session.choose "Male"
@session.clicks_button
@session.click_button
end

it "should fail if the radio button is disabled" do
Expand All @@ -75,7 +75,7 @@
EOS
@session.should_receive(:post).with("/login", "first_option" => "on")
@session.choose "first_option"
@session.clicks_button
@session.click_button
end

it "should result in the value on being posted if not specified and checked by default" do
Expand All @@ -86,7 +86,7 @@
</form>
EOS
@session.should_receive(:post).with("/login", "first_option" => "on")
@session.clicks_button
@session.click_button
end

it "should result in the value of the selected radio button being posted when a subsequent one is checked by default" do
Expand All @@ -101,6 +101,6 @@
EOS
@session.should_receive(:post).with("/login", "user" => {"gender" => "M"})
@session.choose "Male"
@session.clicks_button
@session.click_button
end
end

0 comments on commit f1bf101

Please sign in to comment.