Commit Graph

386 Commits

Author SHA1 Message Date
Aaron Patterson
ba43b9bf5f fixing wildcard path matching when wildcard is inside parenthesis 2011-07-26 17:33:22 -07:00
Erik Michaels-Ober
b9c9142603 Allow a route to have :format => true
When format is true, it is mandatory (as opposed to :format => false).
This is currently not possible with resource routes, which automatically
make format optional by default.
2011-07-25 11:37:25 -07:00
Santiago Pastorino
8e0061128e Merge pull request #2245 from davidtrogers/constraints_block_passed_to_following_routes_in_same_scope
Memoizing @blocks & disposing of constraints options properly
2011-07-25 10:32:31 -07:00
Dave Rogers
4dc42f5353 Ensure the constraints block is only applied to the correct route
addresses issue #1907 - any routes that follow a route with a constraints
  block are inheriting the previous route's constraints.
2011-07-25 09:59:53 -07:00
thedarkone
036f77574d Make polymorphic_url calls go through application helpers again.
This brings back the ability to overwrite/extend url generating methods in application heleprs.
2011-07-25 13:43:02 +02:00
ogeidix
1ac802fe3c Check Accept and Content-Type headers before evaluating them in xhr requests. Closes #2119
An xhr request must have an "Accept" or "Content-type" header in order to be considered a request with valid_accept_header.
2011-07-19 22:05:16 +02:00
Bradford Folkens
4755930727 assert nothing raised for setting a cookie value to nil in ActionDispatch 2011-07-14 14:01:39 -05:00
José Valim
f34f0b7e08 Add has_key? and key? methods to CookieJar removed in 0ca69ca65f 2011-06-30 08:01:53 -03:00
Arun Agrawal
8c1f62acda No need to register again. As it's default now.
Removing gif from here because when it got unregister it start failing other places.
2011-06-28 18:20:28 +05:30
Arun Agrawal
1b957177e7 Fix test to use Mime::Zip 2011-06-28 16:51:19 +05:30
Lukáš Konarovský
c0d82ba030 Use assert_equal instead of assert in uploaded file test. 2011-06-15 03:09:27 -07:00
Damien Mathieu
383fd143bf all requests are utf-8. Don't use the external encoding. 2011-06-14 17:01:33 +02:00
Damien Mathieu
383d56b5ee encode the uploaded file's name in the default external encoding - Closes #869 2011-06-14 14:34:30 +02:00
Santiago Pastorino
1d3618a9b4 remove warning: assigned but unused variable 2011-06-08 00:26:09 -03:00
Andrew White
e864ff7259 Add backward compatibility for testing cookies
This commit restores the ability to assign cookies for testing via
@request.env['HTTP_COOKIE'] and @request.cookies, e.g:

    @request.env['HTTP_COOKIE'] = 'user_name=david'
    get :index
    assert_equal 'david', cookies[:user_name]

and

    @request.cookies[:user_name] = 'david'
    get :index
    assert_equal 'david', cookies[:user_name]

Assigning via cookies[] is the preferred method and will take precedence
over the other two methods. This is so that cookies set in controller
actions have precedence and are carried over between calls to get, post, etc.
2011-06-05 12:34:27 +01:00
Andrew White
0a9270417c Ensure cookie keys are strings 2011-06-05 12:03:31 +01:00
Andrew White
d4658d86fe Refactor ActionController::TestCase cookies
Assigning cookies for test cases should now use cookies[], e.g:

  cookies[:email] = 'user@example.com'
  get :index
  assert_equal 'user@example.com', cookies[:email]

To clear the cookies, use clear, e.g:

  cookies.clear
  get :index
  assert_nil cookies[:email]

We now no longer write out HTTP_COOKIE and the cookie jar is
persistent between requests so if you need to manipulate the environment
for your test you need to do it before the cookie jar is created.
2011-06-04 07:09:11 +01:00
Josh Kalderimis
d182b6ee9c removed deprecated methods, and related tests, from ActionPack 2011-05-24 23:38:59 +02:00
Jon Leighton
d411c85a65 Replace references to ActiveSupport::SecureRandom with just SecureRandom, and require 'securerandom' from the stdlib when active support is required. 2011-05-23 20:25:44 +01:00
steve
2d50887b24 adding test 2011-05-19 10:33:18 -04:00
José Valim
324f1451b0 Dump and load rack-cache stuff. 2011-05-17 17:33:17 -04:00
José Valim
3aa8f348ef Fix previous commit by allowing a proc to be given as response_body. This is deprecated and is going to be removed in future releases. 2011-05-10 16:53:57 +02:00
José Valim
4d5ce4738b Merge pull request #446 from danielstutzman/response_body_is_proc
New test: setting response_body to a Proc should be supported.
2011-05-10 07:38:43 -07:00
Daniel Stutzman
2ab42dcc3e New test: setting response_body to a Proc should be supported. 2011-05-07 16:35:56 -06:00
David Lee
17a91a6ef9 Logs should show overridden method; Issue 426 2011-05-07 03:04:26 -07:00
José Valim
0e5adbceb7 Don't pluralize, camelize. 2011-05-06 17:00:59 +02:00
José Valim
afc3ccf74c Fix renew feature on cookies. 2011-05-04 20:12:27 +02:00
José Valim
6b79463ed8 Fix .subdomain regression. 2011-05-04 20:05:35 +02:00
Matias Korhonen
49b825e502 Sets the HTTP charset parameter for rescue response. 2011-05-03 16:30:59 +03:00
José Valim
e1c1685016 Static middleware accepts cache control. 2011-05-03 12:32:14 +02:00
José Valim
ed3e667415 Multipart is now fixed in Rack. 2011-05-03 12:10:11 +02:00
José Valim
11db2ae4e0 Koz asked to test something crazy. 2011-05-02 23:45:24 +02:00
José Valim
73c94ed97a Add ignore_accept_header config to AD::Request. 2011-05-02 23:38:57 +02:00
Prem Sichanugrist
8c9e4d5202 Add ActionController::ParamsWrapper to wrap parameters into a nested hash
This will allow us to do a rootless JSON/XML request to server.
2011-05-03 03:21:43 +07:00
Piotr Sarnacki
f545a5081e Fix tests, main_app mounted helper must be defined explicitly now. 2011-04-25 17:57:52 +02:00
José Valim
a66c917235 Do not inherit from Rack::Response, remove a shit-ton of unused code. 2011-04-19 11:54:12 +02:00
José Valim
d5ad92ced1 Make static faster as we don't have to serve multiple paths anymore. 2011-04-15 20:09:39 +02:00
Prem Sichanugrist
733bfa63f5 Remove #among? from Active Support
After a long list of discussion about the performance problem from using varargs and the reason that we can't find a great pair for it, it would be best to remove support for it for now.

It will come back if we can find a good pair for it. For now, Bon Voyage, `#among?`.
2011-04-13 20:25:28 +08:00
David Heinemeier Hansson
d1575ae1b9 Change Object#either? to Object#among? -- thanks to @jamesarosen for the suggestion! 2011-04-12 00:23:07 +02:00
Prem Sichanugrist
d6edaeeaf8 Fix failing test case on master
It turned out that I overlook at some replacements ..
2011-04-10 22:40:21 -07:00
Prem Sichanugrist
a9f3c9da01 Using Object#in? and Object#either? in various places
There're a lot of places in Rails source code which make a lot of sense to switching to Object#in? or Object#either? instead of using [].include?.
2011-04-11 03:17:09 +08:00
Santiago Pastorino
03d561ad77 Revert "Use freeze instead of close!"
This reverts commit 29592a7f09.
2011-04-07 09:26:04 -03:00
Santiago Pastorino
17205435f8 cookies here 2011-04-07 09:20:35 -03:00
Santiago Pastorino
29592a7f09 Use freeze instead of close! 2011-04-06 20:53:48 -03:00
Santiago Pastorino
9f765f4e09 Delete useless arguments 2011-04-06 19:18:41 -03:00
Santiago Pastorino
ed04243629 Delete useless env variable 2011-04-06 19:15:33 -03:00
Santiago Pastorino
0d45567362 Add tests to verify that signed and permanent cookies raises if someone tries
to modify the cookies when it was already streamed back to the client
or converted to HTTP headers
2011-04-06 19:12:35 -03:00
Santiago Pastorino
0c5aded092 raise if someone tries to modify the cookies when it was already streamed back to the client or converted to HTTP headers 2011-04-06 15:47:58 -03:00
Sebastian Martinez
52351bcfeb Remove 'warning: ambiguous first argument' when running ActionPack tests
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-03-29 10:23:10 -03:00
Prem Sichanugrist
84a4ef63a4 Move mapper_test to the appropriate location
It seems like in 89c5b9aee7 Aaron actually put the test in action_dispatch folder. However, there's already a `test/dispatch` directory which I think it's more appropriate.

Signed-off-by: Andrew White <andyw@pixeltrix.co.uk>
2011-03-29 10:12:17 +01:00