Commit Graph

70 Commits

Author SHA1 Message Date
Andrew White
7336b33008 Refactor the handling of default_url_options in integration tests
This commit improves the handling of default_url_options in integration
tests by making behave closer to how a real application operates.

Specifically the following issues have been addressed:

* Options specified in routes.rb are used (fixes #546)
* Options specified in controllers are used
* Request parameters are recalled correctly
* Tests can override default_url_options directly
2012-05-10 21:33:31 +01:00
Arun Agrawal
6e49b3d006 assert => assert_equal 2012-02-25 21:13:53 +05:30
Arun Agrawal
406ece4729 fixed build for ruby187-p358 2012-02-25 17:50:47 +05:30
Santiago Pastorino
3200cd072e Revert "Make process reuse the env var passed as argument"
This reverts commit 0e4748cd41.
2011-09-24 17:22:29 -03:00
Santiago Pastorino
0e4748cd41 Make process reuse the env var passed as argument 2011-04-06 16:37:55 -03:00
Aaron Patterson
dfa331ae15 use a method that actually exists 2010-10-01 17:54:50 -07:00
Carlos Antonio da Silva
7fc1edd790 Remove deprecated stuff in ActionController
This removes all deprecated classes in ActionController related to
Routing, Abstract Request/Response and Integration/IntegrationTest.
All tests and docs were changed to ActionDispatch instead of ActionController.
2010-09-26 02:13:45 +08:00
Piotr Sarnacki
b3eb26a161 Removed deprecated RouteSet API, still many tests fail 2010-09-05 13:44:36 +02:00
Neeraj Singh
73f0e1a842 Use assert_respond_to because it has better error messaging
[#4628 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-18 02:12:06 +02:00
Joshua Peek
570c54c39a Fix cookie access in integration tests with other host names 2010-04-05 15:22:09 -07:00
wycats
ab8bf9e152 * Change the object used in routing constraints to be an instance of
ActionDispatch::Request rather than Rack::Request.

* Changed ActionDispatch::Request#method to return a String, to be
  compatible with the Rack::Request superclass.

* Changed ActionDispatch::Request#method to return the original
  method in the case of methodoverride and #request_method not to,
  to be compatible with Rack::Request
2010-04-03 20:24:30 -07:00
Joshua Peek
17f0c1e9e8 Fix stack overflow bug in integration test router helpers 2010-03-30 13:58:18 -05:00
wycats
15c31c7639 open_session can just return the a dup of the current context.
At this point, its entire purpose in the open_session {} case was to
delegate back to the IntegrationTest anyway.
2010-03-22 17:14:28 -07:00
Jeremy Kemper
5e3e5ac12b Clarify cookie jar test 2010-03-04 15:31:28 -08:00
Carl Lerche
fb14b8c6fd ActionDispatch::Request deprecates #request_uri
* Refactored ActionPatch to use fullpath instead
2010-03-03 21:24:00 -08:00
Carlhuda
5e0a05b8cb Tweak the semantic of various URL related methods of ActionDispatch::Request 2010-03-03 21:23:34 -08:00
Carlhuda
050831803a If IntegrationSession is initialized with an objects that responds to #routes, automatically extend the URL helpers from the RouteSet onto it 2010-02-26 17:18:45 -08:00
Carlhuda
98f77e0827 Rename named_url_helpers to url_helpers and url_helpers to url_for 2010-02-26 15:04:50 -08:00
Carlhuda
f863045c45 Rename metaclass to singleton_class 2010-02-25 17:56:58 -08:00
Carlhuda
8760add31a Get URL helpers working again in integration tests. 2010-02-25 17:53:30 -08:00
Carlhuda
226dfc2681 WIP: Remove the global router 2010-02-25 17:53:00 -08:00
Joshua Peek
3eaf525213 Make HEAD method masquerade as GET so requests are routed correctly 2010-01-15 12:38:50 -06:00
Jeremy Kemper
0ff8f81adc Ruby 1.9: more constant lookup badness :( 2009-11-04 15:00:19 -08:00
Joshua Peek
a5c82a9dfb Start rewriting some internal tests to use the new routing dsl 2009-10-20 16:03:55 -05:00
George Ogata
3de8b44b26 Make IntegrationTest::Runner propagate method_missing to ancestors.
Fixes RSpec integration example groups, which mixes its Matchers
module into ActiveSupport::TestCase.

Signed-off-by: Michael Koziarski <michael@koziarski.com>
2009-10-15 11:01:42 +13:00
Joshua Peek
84e94551f6 Add custom "with_routing" to internal tests to fix reseting session after using
with_routing. This only affects our internal AP tests.
2009-10-03 20:45:49 -05:00
Joshua Peek
acfeec5151 Allow integration test rack app to be set with "@app" ivar instead of using open_session 2009-09-26 20:51:05 -05:00
Joshua Peek
088ce2904d Fix generic url rewriter in integration tests 2009-09-25 11:10:39 -05:00
Joshua Peek
db0af8075d Avoid conflict with a "MetalTest" module used in tests 2009-09-19 12:52:52 -05:00
Joshua Peek
ab8aac09d6 Need to reset session in internal integration tests after altering the route set 2009-09-06 22:01:58 -05:00
Jeremy Kemper
4e3fd23e31 test depends on html-scanner 2009-05-23 03:10:48 -07:00
Bryan Helmkamp
0029d5e594 Integrating Rack::MockSession (from Rack::Test) 2009-05-19 22:43:21 -05:00
Pratik Naik
4a6f4b92ad Change integration test helpers to accept Rack environment instead of just HTTP Headers.
Before :  get '/path', {}, 'Accept' => 'text/javascript'
  After  :  get '/path', {}, 'HTTP_ACCEPT' => 'text/javascript'
2009-05-19 23:50:03 +02:00
Joshua Peek
9bac470c7a Group integration test helpers and delegate other helpers to request and response objects 2009-04-30 14:28:42 -05:00
Joshua Peek
6940c0de12 Unify functional and integration tests cookie helpers 2009-04-26 11:37:11 -05:00
Joshua Peek
dd2ed32418 Start to integrate some of the features in Rack::Test.
Eventually commit ActionDispatch::Test::MockRequest and ActionDispatch::Test:: UploadedFile upstream.
2009-04-24 20:24:54 -05:00
Joshua Peek
4185a4a5f5 update rack fixture to be ruby 1.9 compat 2009-03-15 23:48:07 -05:00
Joshua Peek
d0e5417861 update rack fixture to be ruby 1.9 compat 2009-03-15 23:25:12 -05:00
Joshua Peek
524d8edf68 Update bundled Rack for Ruby 1.9 spec changes 2009-02-07 16:18:09 -06:00
Jeremy Kemper
278186534c Bump mocha requirement for Ruby 1.9 compat. Remove uses_mocha. 2009-02-03 18:40:22 -08:00
Joshua Peek
5b5d0e325d Use Rack::Head middleware to ensure the body is discarded for HEAD requests 2009-02-01 01:01:49 -06:00
Pratik Naik
c99ef814b0 Revert "HTTP Digest authentication [#1230 state:resolved]"
This reverts commit 45dee3842d.

Reasons :

1. The code is not working in it's current state
2. Should not be using exceptions for flow control
2009-01-13 16:13:42 +00:00
Joshua Peek
b7ea4add86 Bump Rack version to 0.9 2009-01-06 15:20:57 -06:00
Joshua Peek
45dee3842d HTTP Digest authentication [#1230 state:resolved] 2008-12-28 15:13:16 -06:00
Joshua Peek
175cb7a963 Fix metal tests 2008-12-17 10:10:24 -06:00
Jesse Newland
97a178bfa4 Decorate responses from Rack Middleware and Rails Metal for the purposes of integration testing. A test for the following Metal:
class Poller < Rails::Rack::Metal
      def call(env)
        if env["PATH_INFO"] =~ /^\/poller/
          [200, {"Content-Type" => "text/plain"}, "Hello World!"]
        else
          super
        end
      end
    end

might be tested like so:

  class PollerTest < ActionController::IntegrationTest
    test "poller returns hello world" do
      get "/poller"
      assert_response 200
      assert_response :success
      assert_response :ok
      assert_equal "Hello World!", response.body
    end
  end

[#1588 state:committed]

Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
2008-12-17 15:59:47 +01:00
Joshua Peek
ed70830713 Switch to Rack based session stores. 2008-12-15 16:33:31 -06:00
Christos Zisopoulos
69387ce016 Fix for Integration::Session follow_redirect! headers['location'] bug with Rack [#1555 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2008-12-10 18:38:28 -06:00
Joshua Peek
ebec9d43e2 Make integration test runner more Rack friendly and clean out old CGI cruft 2008-12-08 12:33:16 -06:00
Joshua Peek
31ce92f7b5 Use autoload instead of explicit requires for ActionController 2008-11-23 16:35:47 -06:00