Class: Webrat::RailsAdapter

Inherits:
Object show all
Includes:
ActionController::RecordIdentifier
Defined in:
lib/webrat/adapters/rails.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

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_sessionObject (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_bodyObject



30
31
32
# File 'lib/webrat/adapters/rails.rb', line 30

def response_body
  response.body
end

#response_codeObject



34
35
36
# File 'lib/webrat/adapters/rails.rb', line 34

def response_code
  response.code.to_i
end

#response_headersObject



38
39
40
# File 'lib/webrat/adapters/rails.rb', line 38

def response_headers
  response.headers
end

#xml_content_type?Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/webrat/adapters/rails.rb', line 42

def xml_content_type?
  response.headers["Content-Type"].to_s =~ /xml/
end