Class: Webrat::RailsAdapter
- Includes:
- ActionController::RecordIdentifier
- Defined in:
- lib/webrat/adapters/rails.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#integration_session ⇒ Object
readonly
Returns the value of attribute integration_session.
Instance Method Summary collapse
- #delete(url, data, headers = nil) ⇒ Object
- #get(url, data, headers = nil) ⇒ Object
-
#initialize(session) ⇒ RailsAdapter
constructor
A new instance of RailsAdapter.
- #post(url, data, headers = nil) ⇒ Object
- #put(url, data, headers = nil) ⇒ Object
- #response_body ⇒ Object
- #response_code ⇒ Object
- #response_headers ⇒ Object
- #xml_content_type? ⇒ Boolean
Constructor Details
#initialize(session) ⇒ RailsAdapter
Returns a new instance of RailsAdapter.
10 11 12 |
# File 'lib/webrat/adapters/rails.rb', line 10 def initialize(session) @integration_session = session end |
Instance Attribute Details
#integration_session ⇒ Object (readonly)
Returns the value of attribute integration_session.
8 9 10 |
# File 'lib/webrat/adapters/rails.rb', line 8 def integration_session @integration_session end |
Instance Method Details
#delete(url, data, headers = nil) ⇒ Object
26 27 28 |
# File 'lib/webrat/adapters/rails.rb', line 26 def delete(url, data, headers = nil) do_request(:delete, url, data, headers) end |
#get(url, data, headers = nil) ⇒ Object
14 15 16 |
# File 'lib/webrat/adapters/rails.rb', line 14 def get(url, data, headers = nil) do_request(:get, url, data, headers) end |
#post(url, data, headers = nil) ⇒ Object
18 19 20 |
# File 'lib/webrat/adapters/rails.rb', line 18 def post(url, data, headers = nil) do_request(:post, url, data, headers) end |
#put(url, data, headers = nil) ⇒ Object
22 23 24 |
# File 'lib/webrat/adapters/rails.rb', line 22 def put(url, data, headers = nil) do_request(:put, url, data, headers) end |
#response_body ⇒ Object
30 31 32 |
# File 'lib/webrat/adapters/rails.rb', line 30 def response_body response.body end |
#response_code ⇒ Object
34 35 36 |
# File 'lib/webrat/adapters/rails.rb', line 34 def response_code response.code.to_i end |
#response_headers ⇒ Object
38 39 40 |
# File 'lib/webrat/adapters/rails.rb', line 38 def response_headers response.headers end |
#xml_content_type? ⇒ Boolean
42 43 44 |
# File 'lib/webrat/adapters/rails.rb', line 42 def xml_content_type? response.headers["Content-Type"].to_s =~ /xml/ end |