Simon Rozet
4e07f5b654
Fix following of absolute redirect URL in Sinatra
...
What's going on when the app redirects to an absolute URL?
* Sinatra relies on Rack::MockSession which sets SERVER_NAME to
"example.org" [1] on request it makes. However, Webrat expects
it to be "www.example.com"
* In MyClassyApp, the redirect URL is made out of Rack::Request#url [2]
which uses SERVER_NAME, which is set to "example.org" by Rack::MockSession.
As a result, Webrat see it as an external redirect and don't follow it.
NOTE:
* SERVER_NAME is stricly equivalent to HTTP_HOST [3]
* This could have been fixed in Webrat::Session too. I'am not sure
that it won't affect other frameworks so I left it intact.
def request_page(url, http_method, data) #:nodoc:
h = headers
h['HTTP_REFERER'] = @current_url if @current_url
+ h['HTTP_HOST'] = 'www.example.com'
[1] 5c00dd698e/lib/rack/mock.rb (L79)
[2] 5c00dd698e/lib/rack/request.rb (L201)
[3] 5c00dd698e/lib/rack/request.rb (L72)
2009-02-28 03:30:26 +01:00
Simon Rozet
7d7c32256d
Support for "modular" Sinatra app style
...
Since Sinatra 0.9, apps can be ancapsulated in a class ("modular" style)
or be on the top level, just like before ("classic" style)
* http://wiki.github.com/brynary/webrat/sinatra
* http://www.sinatrarb.com/extensions.html
2009-02-28 03:30:25 +01:00
Bryan Helmkamp
4769a5f90b
Detect infinite redirects and raise a Webrat::InfiniteRedirectError (Daniel Lucraft)
2009-02-08 20:54:00 -05:00
Bryan Helmkamp
238bfb469e
Use redgreen when running rails integraton tests if available
2009-01-25 19:48:02 -05:00
Mike Gaffney
3d5dd1343c
turning off have_tag test for now until we figure out whether we want it or not. Making integration not run the selenium tests for now. Need a eventually framework for test::unit
2009-01-25 18:30:03 -06:00
Amos King
0a021059d6
Added to rails test for have_tag
2009-01-23 21:13:52 -06:00
Amos King
0b8e378fb2
change to use rails label tag for test.
2009-01-23 20:56:16 -06:00
Amos King
813adcc238
Remove the rails selenium test directory and change rake tasks for selenium and rails modes to run the same tests. The end goal should be that the same tests run in both Seleium and Webrat.
2009-01-23 15:37:26 -06:00
Amos King
da59584cdf
add the ability for selenium mode to create pids dirs
2009-01-23 15:34:51 -06:00
Amos King
2c9b546a83
Merge branch 'lh_120_tests_with_selenium' of git@github.com:gaffo/webrat into lh_82
...
Conflicts:
spec/integration/rails/test/integration/webrat_test.rb
2009-01-23 15:11:16 -06:00
Zach Dennis
0272e81847
Fixed issue where webrat was only using relative paths when making requests for Rails apps. This borked Rails apps that use subdomains [John Hwang/Zach Dennis]
2009-01-20 21:48:48 -05:00
Bryan Helmkamp
14d114ce1d
Ensure the previous pages params aren't passed through redirect
2009-01-19 13:56:22 -05:00
Bryan Helmkamp
6676ae2da9
Adding integration test for field_labeled
2009-01-17 17:13:20 -05:00
Bryan Helmkamp
7a7cb3f002
Support passing an ActiveRecord model to #within when in Rails mode [ #68 state:resolved] (Luke Melia)
2009-01-17 13:18:42 -05:00
Amos King
652610381a
added selenium test for assert_selector
2009-01-13 22:48:57 -06:00
Amos King
fd860a2e6d
added rails test for assert_selector
2009-01-13 22:48:06 -06:00
Amos King
a32ec70d7f
added xpath test to selenium
2009-01-13 22:45:26 -06:00
Amos King
647eb4cb6f
add test for assert_xpath
2009-01-13 22:43:31 -06:00
Amos King
2d065e8a2d
add test for click_link with id to selenium
2009-01-13 22:43:14 -06:00
Amos King
0aa5fda61d
added click link test to selenium
2009-01-13 22:35:58 -06:00
Amos King
2510e7d43d
added clicking link by id
2009-01-13 22:34:47 -06:00
Amos King
3902573d3e
add a link to the rendered text and add a test for clicking it
2009-01-13 22:33:47 -06:00
Amos King
a396758da4
fixed rakefile so the tasks will run the correct mode, and so there is a task to run both modes.
2009-01-13 07:57:20 -06:00
Mike Gaffney
758e323f89
breaking up selenium from rails_webrat tests for the moment
2009-01-13 00:26:49 -06:00
Mike Gaffney
c0220232c7
broke selenium mode tests out into a seperate file.
2009-01-13 00:13:17 -06:00
Mike Gaffney
c1b49f36ea
working on getting standardized for the specs
2009-01-12 23:31:14 -06:00
Mike Gaffney
f7f8c91cb7
getting selenium up and running
2009-01-12 22:54:33 -06:00
Mike Gaffney
f2a202ae5e
adding pids directories
2009-01-12 22:44:53 -06:00
Mike Gaffney
f835bac31b
cleaning out app and getting selenium mode to work
2009-01-12 22:42:35 -06:00
Mike Gaffney
bdf660aecb
Renamed the task for seleniumw
2009-01-12 22:30:36 -06:00
Mike Gaffney
a8a63472bc
breaking the test mode out into a specific test modes
2009-01-12 22:30:03 -06:00
Josh Knowles
9825aee47e
Don't follow external redirects
2009-01-04 23:56:52 -05:00
Nicolas Sanguinetti
4565a3cea6
Unescape the values passed to the sinatra test helpers
2009-01-04 22:36:21 -05:00
Josh Knowles
34ea3e64b8
Sinatra integration tests for following redirects
2009-01-04 22:34:47 -05:00
Josh Knowles
c3120833b0
Merge branch 'foca/master'
2009-01-04 21:57:25 -05:00
Josh Knowles
e19b1cc323
Rails and Merb integration tests for following redirects
2008-12-29 23:14:26 -05:00
Josh Knowles
7044eb5863
Make merb integration test load 'local' webrat, instead of the gem.
2008-12-29 22:14:58 -05:00
Nicolas Sanguinetti
7258ea3349
Make rails integration test load 'local' webrat, instead of the gem.
2008-12-29 22:14:52 -05:00
Nicolas Sanguinetti
499dcefefe
Add integration tests for sinatra
2008-12-29 06:41:50 -02:00
Nicolas Sanguinetti
33e853710e
Make rails integration test load 'local' webrat, instead of the gem.
2008-12-29 06:41:30 -02:00
Bryan Helmkamp
2562942b6d
Adding merb app for integration testing
2008-12-29 02:10:05 -05:00
Bryan Helmkamp
add38820e5
Adding two tests for Rails integration
2008-12-29 01:30:26 -05:00
Bryan Helmkamp
39e0200608
Adding a Rails app for integration testing
2008-12-29 01:11:41 -05:00
Bryan Helmkamp
ed6f7fc4a2
Moving around some specs
2008-10-25 12:22:55 -04:00
Bryan Helmkamp
2e20267c90
Switch from Mocha to RSpec mocks
2008-07-25 19:11:56 -04:00
Bryan Helmkamp
cf6b9d26c0
Start isolating Rails-specific webrat components to prepare for additional modes (Merb and WWW::Mechanize)
2008-05-11 23:58:20 -04:00