Class: Webrat::RailsSession
Overview
Instance Attribute Summary
Attributes inherited from Session
#current_url, #elements
Instance Method Summary
collapse
Methods inherited from Session
#automate, #basic_auth, #click_link_within, #current_dom, #current_page, #current_scope, #dom, #exception_caught?, #formatted_error, #header, #headers, #http_accept, #initialize, #open_in_browser, #page_scope, #reloads, #request_page, #rewrite_css_and_image_references, #save_and_open_page, #scopes, #simulate, #success_code?, #visit, #within
Methods included from Logging
#debug_log, #logger
Instance Method Details
#delete(url, data, headers = nil) ⇒ Object
27
28
29
|
# File 'lib/webrat/rails.rb', line 27
def delete(url, data, = nil)
do_request(:delete, url, data, )
end
|
7
8
9
|
# File 'lib/webrat/rails.rb', line 7
def doc_root
File.expand_path(File.join(RAILS_ROOT, 'public'))
end
|
#get(url, data, headers = nil) ⇒ Object
15
16
17
|
# File 'lib/webrat/rails.rb', line 15
def get(url, data, = nil)
do_request(:get, url, data, )
end
|
#post(url, data, headers = nil) ⇒ Object
19
20
21
|
# File 'lib/webrat/rails.rb', line 19
def post(url, data, = nil)
do_request(:post, url, data, )
end
|
#put(url, data, headers = nil) ⇒ Object
23
24
25
|
# File 'lib/webrat/rails.rb', line 23
def put(url, data, = nil)
do_request(:put, url, data, )
end
|
#response_body ⇒ Object
31
32
33
|
# File 'lib/webrat/rails.rb', line 31
def response_body
response.body
end
|
#response_code ⇒ Object
35
36
37
|
# File 'lib/webrat/rails.rb', line 35
def response_code
response.code.to_i
end
|
#saved_page_dir ⇒ Object
11
12
13
|
# File 'lib/webrat/rails.rb', line 11
def saved_page_dir
File.expand_path(File.join(RAILS_ROOT, "tmp"))
end
|
#xml_content_type? ⇒ Boolean
39
40
41
|
# File 'lib/webrat/rails.rb', line 39
def xml_content_type?
response.["Content-Type"].to_s =~ /xml/
end
|