Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions README.rdoc
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
= Webrat - Ruby Acceptance Testing for Web applications

- http://gitrdoc.com/brynary/webrat
- http://groups.google.com/group/webrat
- http://webrat.lighthouseapp.com/
- http://github.com/brynary/webrat
- #webrat on Freenode
- http://github.com/jbrien/webrat

== Description

Webrat lets you quickly write expressive and robust acceptance tests for a Ruby
web application.
This is my version to correct the session issues with a Rails 3 application. Webrat lets you quickly write expressive and robust acceptance tests for a Ruby web application.

== Features

Expand Down Expand Up @@ -53,11 +49,11 @@ Otherwise the Nokogiri gem, which Webrat depends on, won't install properly.

To install the latest release as a gem:

sudo gem install webrat
sudo gem install jbd-webrat

To install the latest code as a plugin: (_Note:_ This may be less stable than using a released version)

script/plugin install git://github.com/brynary/webrat.git
script/plugin install git://github.com/jbrien/webrat.git

In your test_helper.rb or env.rb (for Cucumber) add:

Expand All @@ -74,12 +70,12 @@ methods from Webrat::Session in your specs.

== Authors

- Updated by {John Brien Dilts}[mailto:[email protected]]
- Maintained by {Bryan Helmkamp}[mailto:[email protected]]
- Original code written by {Seth Fitzsimmons}[mailto:[email protected]]
- Initial development was sponsored by EastMedia[http://www.eastmedia.com]
- Many other contributors. See attributions in History.txt

== License

Copyright (c) 2007-2008 Bryan Helmkamp, Seth Fitzsimmons.
See MIT-LICENSE.txt in this directory.
12 changes: 10 additions & 2 deletions lib/webrat/core/session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,18 @@ def process_request(http_method, url, data, headers)
def response_location
response_headers['Location']
end

def current_host
URI.parse(current_url).host || @custom_headers["Host"] || "www.example.com"
URI.parse(current_url).host || @custom_headers["Host"] || default_current_host
end

def default_current_host
adapter.class == Webrat::RackAdapter ? "example.org" : "www.example.com"
end

#def current_host
# URI.parse(current_url).host || @custom_headers["Host"] || "www.example.com"
#end

def response_location_host
URI.parse(response_location).host || "www.example.com"
Expand Down
12 changes: 6 additions & 6 deletions webrat.gemspec
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# -*- encoding: utf-8 -*-

Gem::Specification.new do |s|
s.name = %q{webrat}
s.version = "0.7.2"
s.name = %q{jbd-webrat}
s.version = "0.7.2.rails3"

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Bryan Helmkamp"]
s.date = %q{2010-10-19}
s.description = %q{Webrat lets you quickly write expressive and robust acceptance tests
s.authors = ["John Brien Dilts", "Bryan Helmkamp"]
s.date = %q{2010-12-16}
s.description = %q{Rails 3 working version of Webrat. Webrat lets you quickly write expressive and robust acceptance tests
for a Ruby web application. It supports simulating a browser inside
a Ruby process to avoid the performance hit and browser dependency of
Selenium or Watir, but the same API can also be used to drive real
Selenium tests when necessary (eg. for testing AJAX interactions).
Most Ruby web frameworks and testing frameworks are supported.}
s.email = %q{bryan@brynary.com}
s.email = %q{brien@pinstails.com}
s.extra_rdoc_files = [
"README.rdoc",
"MIT-LICENSE.txt",
Expand Down