forked from brynary/webrat
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
498 additions
and
497 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
require File.join(File.dirname(__FILE__), "webrat", "rails_extensions") | ||
require File.join(File.dirname(__FILE__), "webrat", "session") | ||
|
||
class Webrat | ||
module Webrat | ||
VERSION = '0.2.1' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,25 @@ | ||
module Webrat | ||
module RedirectActions | ||
def put_via_redirect(path, parameters = {}, headers = {}) | ||
put path, parameters, headers | ||
follow_redirect! while redirect? | ||
status | ||
end | ||
|
||
def delete_via_redirect(path, parameters = {}, headers = {}) | ||
delete path, parameters, headers | ||
follow_redirect! while redirect? | ||
status | ||
end | ||
end | ||
end | ||
|
||
# Waiting for http://dev.rubyonrails.org/ticket/10497 to be committed. | ||
|
||
module ActionController | ||
module Integration | ||
|
||
class Session | ||
|
||
unless instance_methods.include?("put_via_redirect") | ||
# Waiting for http://dev.rubyonrails.org/ticket/10497 to be committed. | ||
def put_via_redirect(path, parameters = {}, headers = {}) | ||
put path, parameters, headers | ||
follow_redirect! while redirect? | ||
status | ||
end | ||
end | ||
|
||
unless instance_methods.include?("delete_via_redirect") | ||
# Waiting for http://dev.rubyonrails.org/ticket/10497 to be committed. | ||
def delete_via_redirect(path, parameters = {}, headers = {}) | ||
delete path, parameters, headers | ||
follow_redirect! while redirect? | ||
status | ||
end | ||
end | ||
|
||
include Webrat::RedirectActions unless instance_methods.include?("put_via_redirect") | ||
end | ||
|
||
end | ||
end |
Oops, something went wrong.