class Capybara::Mechanize::Browser::ResponseProxy

Attributes

page[R]

Public Class Methods

new(page) click to toggle source
# File lib/capybara/mechanize/browser.rb, line 156
def initialize(page)
  @page = page
end

Public Instance Methods

[](key) click to toggle source
# File lib/capybara/mechanize/browser.rb, line 171
def [](key)
  headers[key]
end
current_url() click to toggle source
# File lib/capybara/mechanize/browser.rb, line 160
def current_url
  page.uri.to_s
end
headers() click to toggle source
# File lib/capybara/mechanize/browser.rb, line 164
def headers
  # Hax the content-type contains utf8, so Capybara specs are failing, need to ask mailinglist
  headers = page.response
  headers["content-type"].gsub!(';charset=utf-8', '') if headers["content-type"]
  headers
end
redirect?() click to toggle source
# File lib/capybara/mechanize/browser.rb, line 179
def redirect?
  status >= 300 && status < 400
end
status() click to toggle source
# File lib/capybara/mechanize/browser.rb, line 175
def status
  page.code.to_i
end