Commit Graph

12035 Commits

Author SHA1 Message Date
Arthur Neves
b6b088429c Add changelog entry for #19271 2015-03-24 15:12:47 -04:00
Andrew White
550c1f0950 Fix failing tests for #19474 2015-03-23 13:15:59 +00:00
Ryan Tomayko
0b81b3094a Fix ActionDispatch::PublicExceptions returning string rack status
The status returned in the rack [status, headers, body] array was
a string, which can cause problems with middleware that assumes the
status will be a Fixnum. This likely never surfaced because other
middleware to_i the status returned from downstream apps before
passing it on.
2015-03-23 13:15:59 +00:00
Gaurav Sharma
29efc6ee05 remove old unavailable link with relevant fix 2015-03-23 11:18:14 +05:30
adam
b49cac80de Fix handling of empty X_FORWARDED_HOST header.
Previously, an empty X_FORWARDED_HOST header would cause
Actiondispatch::Http:URL.raw_host_with_port to return nil, causing
Actiondispatch::Http:URL.host to raise a NoMethodError.
2015-03-20 20:32:30 +00:00
Jeremy Kemper
5154089c18 Revert "Merge pull request #19404 from dmathieu/remove_rack_env"
Preserving RACK_ENV behavior.

This reverts commit 7bdc7635b885e473f6a577264fd8efad1c02174f, reversing
changes made to 45786be516e13d55a1fca9a4abaddd5781209103.
2015-03-20 08:14:11 -07:00
eileencodes
adae55f476 Fix kwargs warning in test_get_xml
ActionDispatch::IntegrationTest HTTP request methods will accept only
certain kwargs in the future. This test caused a deprecation warning
when running ActionPack tests. Added `params` and `headers` to fix.
2015-03-20 08:48:10 -04:00
Akshay Vishnoi
c27b2df561 Fix test messages use directly true, false and nil instead of their symbol 2015-03-19 23:47:58 +05:30
Damien Mathieu
d578cbfb5c don't fallback to RACK_ENV when RAILS_ENV is not present 2015-03-19 10:06:28 +01:00
Boris Peterbarg
4be3997c9f Compare content_type with Mime::XML instead of regexp
Regexp is broken for both content types including charsets and for
integration tests, where the content_type is a Mime::Type and not String
2015-03-16 06:35:00 +02:00
Mike Naberezny
849148b35f Fix typo in Action Pack changelog. [ci skip] 2015-03-14 13:08:55 -07:00
Rafael Mendonça França
cf5ec92a8b Merge pull request #19291 from hired/return-truthy-value-from-head
Return truthy value from head method
2015-03-13 11:06:20 -03:00
Joel Hayhurst
d5efb1f9bd Return true from head method
It was returning false in normal circumstances.
This broke the `head :ok and return if` construct.
Add appropriate test.
2015-03-12 14:39:22 -07:00
Guillermo Iguaran
ccf8678cec Merge pull request #19309 from f1sherman/dont-set-session-options-id
Use request.session.id instead of request.session_options[:id]
2015-03-12 11:30:12 -05:00
Arthur Nogueira Neves
ba7e5530d8 Merge pull request #19271 from eagletmt/304-content-type
304 response should not include Content-Type header
2015-03-12 11:40:18 -04:00
Brian John
82402e6583 Use request.session.id instead of request.session_options[:id]
As of the upgrade to Rack 1.5, request.session_options[:id] is no
longer populated. Reflect this change in the tests by using
request.session.id instead.

Related change in Rack:
https://github.com/rack/rack/commit/83a270d6
2015-03-12 09:52:38 -05:00
Kohei Suzuki
b60c1fe97b Also skip Content-Encoding and Vary header if 304 2015-03-12 23:32:07 +09:00
Rafael Mendonça França
2c1f6267f9 Merge pull request #19252 from kaspth/single-escaping-strip-tags
Let strip_tags leave HTML escaping to Rails.
2015-03-10 16:05:47 -03:00
Kasper Timm Hansen
37695b8aab Let strip_tags leave HTML escaping to Rails.
Prevents double escaping errors, such as "&" becoming "&".
2015-03-10 20:04:01 +01:00
Kohei Suzuki
d4103fc232 304 response should not include Content-Type header
Rack::Lint raises an error saying "Content-Type header found in 304
response, not allowed".
2015-03-10 23:39:08 +09:00
eileencodes
2e4a01b92c Call super last in before_setup
This fixes the reasons 4cf3b8a, 303567e, and fa63448 needed to be
reverted in 7142059. The revert has been reverted and this fixes
the issues caused previously.

If we call `super` first we will end up nuking the session settings in the
application tests that do `setup do` - so any session login or cookie
settings will not be persisted thoughout the test sessions.

Calling `super` last prevents `@integration_session` from getting nuked
and set to nil if it's already set.

Test added to prevent regression of this behavior in the future.
2015-03-09 17:11:15 -04:00
eileencodes
d5e55e960c Revert "Revert integration test refactoring that caused app test regressions"
This reverts commit 714205988315d2f98aa3e749747c44470e18676b.
2015-03-09 17:10:24 -04:00
Peter Suschlik
f0768eba28 Target Ruby 2.2.1 in gemspecs
This is a follow-up to #19257
2015-03-09 09:56:26 +01:00
yuuji.yaginuma
fbb11854c7 update integration test example as is not output deprecation warning [ci skip] 2015-03-07 14:28:47 +09:00
Guillermo Iguaran
809527b282 Merge pull request #19231 from prathamesh-sonpatki/fix-url-for-documentation
Fix documentation of url_for module [ci skip]
2015-03-06 15:49:37 -05:00
Prathamesh Sonpatki
e049319c77 Fix documentation of url_for module [ci skip]
- The request needs to be instance of ActionDispatch::Request or an
   object that responds to host, optional_port, protocol and
   symbolized_path_parameter.
 - This documentation was correctly added in
   e3b3f416b5
   but was changed to
   e1ceae576e.
 - Fixes #16160.
2015-03-06 19:51:07 +05:30
Matthew Draper
c96cb66351 Merge pull request #19221 from matthewd/random-tests
Run all our tests in random order
2015-03-06 23:02:49 +10:30
Aaron Patterson
798a14a638 pass a config to the route set
This way we can get the relative_url_root from the application without
setting another global value
2015-03-05 13:12:06 -08:00
Matthew Draper
e462021396 Revert "For now, we will keep sorting the tests."
This reverts commit 7025d7769dc53f0a3ffab8b537727ef3fee367fc.
2015-03-06 04:39:20 +10:30
Sean Griffin
f18b5fe9b1 Merge pull request #19215 from gsamokovarov/revert-ruby-2-2-0-kwarg-crash-workarounds
Revert work arounds for upstream Ruby 2.2.0 kwargs bug
2015-03-05 10:58:16 -07:00
Kasper Timm Hansen
d2a9bd1ae4 Merge pull request #19218 from sivsushruth/doc_fix
Added doc [ci skip]
2015-03-05 18:12:00 +01:00
Sushruth Sivaramakrishnan
5ea829815e nodoc filtered_location [ci skip] 2015-03-05 22:40:22 +05:30
Guo Xiang Tan
dad40bf9ea Run ActionPack test cases in random order. 2015-03-06 00:24:22 +08:00
Genadi Samokovarov
8ed0b89bbd Revert work arounds for upstream Ruby 2.2.0 kwargs bug
The bug caused a segfault and you can find more info about it at:
https://bugs.ruby-lang.org/issues/10685.

We did a couple of work arounds, but 2.2.1 rolled out and those aren't
needed anymore.

Here are the reverted commits:

- Revert "Work around for upstream Ruby bug #10685",
  commit 707a433870e9e06af688f85a4aedc64a90791a64.

- Revert "Fix segmentation fault in ActionPack tests",
  commit 22e0a22d5f98e162290d9820891d8191e720ad3b.

I'm also bumping the Ruby version check to 2.2.1 to prevent future
segfaults.
2015-03-05 17:39:22 +02:00
Sushruth Sivaramakrishnan
7f10d72dd2 Doc fix [ci skip] 2015-03-05 19:30:20 +05:30
Sushruth Sivaramakrishnan
d7c1293c5b Doc fix [ci skip] 2015-03-05 18:31:40 +05:30
Sushruth Sivaramakrishnan
72e5fde811 Doc fix [ci skip] 2015-03-05 16:36:48 +05:30
Aaron Patterson
c2108926a4 Drop request class from RouteSet constructor.
If you would like to use a custom request class, please subclass and implemet
the `request_class` method.
2015-03-04 11:02:24 -08:00
Robin Dupret
8a74190121 Tiny documentation edits [ci skip] 2015-03-03 21:30:20 +01:00
Rafael Mendonça França
44ff0313c1 Merge pull request #18775 from yasyf/issue_5122
Fallback to RAILS_RELATIVE_URL_ROOT in `url_for`
2015-03-03 17:19:42 -03:00
Eileen M. Uchitelle
f32b6e243a Merge pull request #19147 from gsamokovarov/work-around-ruby-10695
Work around for upstream Ruby bug #10685
2015-03-02 18:22:31 -05:00
Aaron Patterson
12f2fc56aa Merge pull request #15806 from tgxworld/partition_routes_during_setup
Partition routes during setup.
2015-03-02 15:02:14 -08:00
Zachary Scott
3d69222ca9 Merge pull request #19181 from davydovanton/update-helper-docs
[ci skip] Add documentation for Helpers#all_helpers_from_path
2015-03-02 14:51:58 -08:00
Anton Davydov
7fd2de464e [ci skip] Add documentation for Helpers#all_helpers_from_path 2015-03-03 01:14:48 +03:00
Aaron Patterson
0814bb62e5 be optimistic about missing route keys
this patch makes errors slightly more expensive when someone is missing
a route key, but in exchange it drops 4 allocations per `url_for` call.
Since missing a route key is an error, optimizing for the non-error path
seems like a good trade off
2015-03-02 11:26:23 -08:00
Aaron Patterson
b1051c5dfa use arg size for parallel iteration
we already know the length of the args, so we can use that length for
parallel iteration and cut down on allocations for `url_for` calls.
2015-03-02 11:16:09 -08:00
Aaron Patterson
37654d12ae ask the routes objects for its Rack env key
this centralizes the logic for determining the script name key and drops
object allocations when calling `engine_script_name` (which is called on
each `url_for`).
2015-03-02 11:01:07 -08:00
Zoltan Kiss
f5b192837a Remove unneeded comment. [ci skip] 2015-03-02 11:03:33 -06:00
Robin Dupret
562b0b2368 Skip the failing tests on Rubinius for now 2015-03-02 17:28:12 +01:00
Robin Dupret
586fe4471d Avoid accurate assertions on error messages
Since there are disparities between the raised error messages on the
different implementations, let's avoid being too accurate.
2015-03-02 14:05:07 +01:00