aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/test_request_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* "Use assert_nil if expecting nil. This will fail in minitest 6."Akira Matsuda2016-12-251-1/+1
|
* Fix memoization bug on ActionDispatch::TestRequest#request_method=Kir Shatrov2016-09-221-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | TestRequest have been overrriding request_method setter since 2009, but the actual implementation in Request (not TestRequest) has been changed since that. Now it's also using @request_method instance variable to keep the state. The override in TestRequest have not been calling `super`, which caused a bug that after accessing #requst_method the value was memoized and then we've never been able to change it anymore: ``` req = ActionDispatch::TestRequest.create puts "was: #{req.request_method}" # memoized here req.request_method = "POST" puts "became: #{req.request_method}" ``` output: ``` was: GET became: GET ``` Since the whole purpose of overriding the setter in TestRequest is to upcase it, I'm changing it to `super(method.to_s.upcase)`
* Add three new rubocop rulesRafael Mendonça França2016-08-161-5/+5
| | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* modernizes hash syntax in actionpackXavier Noria2016-08-061-1/+1
|
* applies new string literal convention in actionpack/testXavier Noria2016-08-061-26/+26
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Remove last uses of `@env[]` and `@env[]=`Jon Moss2016-04-281-0/+27
| | | | | | | | | Last August (2015), @tenderlove worked to remove all `@env[]` and `@env[]=`, in favor of using `set_header`, `get_header`, etc. (Here's an [example commit](https://github.com/rails/rails/commit/f16a33b68efc3dc57cfafa27651b9a765e363fbf)). This PR should remove the last uses of these methods, and fully convert them to the newly standardized API.
* Get rid of mocha tests - part 1Marcin Olichwirowicz2015-08-241-3/+1
|
* add a new constructor for allocating test requestsAaron Patterson2015-07-081-9/+9
|
* make `env` a required parameterAaron Patterson2015-07-081-6/+6
|
* pass cookies from the jar in the HTTP_COOKIE headereileencodes2015-07-071-2/+0
| | | | | we should be pushing the cookies in via headers rather than maintaining some object and "recycling" it.
* Use released rackGodfrey Chan2014-12-191-1/+1
| | | | `rack.version` was bumped in https://github.com/rack/rack/commit/28e77c710ac2ddb35c436d78d72e28f28f964446
* Allow overriding of all headers from passed environment hashAndrew White2013-07-251-0/+30
| | | | | | | Allow REMOTE_ADDR, HTTP_HOST and HTTP_USER_AGENT to be overridden from the environment passed into `ActionDispatch::TestRequest.new`. Fixes #11590
* Integrate Action Pack with Rack 1.5Carlos Antonio da Silva2013-01-251-1/+1
| | | | | | All ActionPack and Railties tests are passing. Closes #8891. [Carlos Antonio da Silva + Santiago Pastorino]
* Remove tabs, use spaces :scissors:Carlos Antonio da Silva2013-01-221-2/+2
| | | | [ci skip]
* Fix bug when Rails.application is defined but is nil. See #881Marc-Andre Lafortune2012-05-211-0/+7
|
* assert nothing raised for setting a cookie value to nil in ActionDispatchBradford Folkens2011-07-141-0/+5
|
* Ensure cookie keys are stringsAndrew White2011-06-051-0/+9
|
* Refactor ActionController::TestCase cookiesAndrew White2011-06-041-6/+9
| | | | | | | | | | | | | | | | | | 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.
* Improve testing of cookies in functional tests:Andrew White2011-03-061-2/+2
| | | | | | | | | - cookies can be set using string or symbol keys - cookies are preserved across calls to get, post, etc. - cookie names and values are escaped - cookies can be cleared using @request.cookies.clear [#6272 state:resolved]
* Expect Rack 1.1Joshua Peek2009-12-261-1/+1
|
* Rack: HTTPS is either 'on' or 'off' as of ↵Jeremy Kemper2009-11-101-1/+1
| | | | 9b7a0569e4067d0c23a00fc24273436e85c56d7f
* Fix a few more 1.9 bugs. Rack 1.0.1 is required for 1.9 compliance but not ↵Yehuda Katz2009-10-151-1/+1
| | | | release, so bundling 1.0.1 from git
* rack-test 0.4.2 has rack 1.1.pre goodies, we'll use it insteadJoshua Peek2009-08-311-2/+2
|
* Fix implicit ordering expectationJeremy Kemper2009-05-021-1/+1
|
* Move TestRequest cookies accessor into AD TestRequestJoshua Peek2009-04-301-0/+15
|
* Depend on unreleased rack 1.1Joshua Peek2009-04-301-1/+1
|
* Start moving TestRequest and TestResponse into ActionDispatchJoshua Peek2009-04-301-0/+30