Commit Graph

270 Commits

Author SHA1 Message Date
Akira Matsuda
146e928800 Don't pollute Object with rubinius_skip and jruby_skip
we call them only in the tests
2017-01-17 18:51:50 +09:00
Akira Matsuda
c82fa18514 Use Encoding::UTF_8 constant for default_{internal,external} in the tests 2017-01-11 17:48:00 +09:00
Rafael Mendonça França
209bfc0a5c
Fix style guide violations 2017-01-05 00:40:24 -05:00
Rafael Mendonça França
fe1f4b2ad5
Add more rubocop rules about whitespaces 2016-10-29 01:17:49 -02:00
Ryuta Kamizono
3464cd5c28 Fix broken comments indentation caused by rubocop auto-correct [ci skip]
All indentation was normalized by rubocop auto-correct at 80e66cc4d90bf8c15d1a5f6e3152e90147f00772.
But comments was still kept absolute position. This commit aligns
comments with method definitions for consistency.
2016-09-14 18:26:32 +09:00
Rafael Mendonça França
55f9b8129a
Add three new rubocop rules
Style/SpaceBeforeBlockBraces
Style/SpaceInsideBlockBraces
Style/SpaceInsideHashLiteralBraces

Fix all violations in the repository.
2016-08-16 04:30:11 -03:00
Kerri Miller
496d744fa3 Allow specifying encoding of parameters by action
At GitHub we need to handle parameter encodings that are not UTF-8. This
patch allows us to specify encodings per parameter per action.
2016-08-09 15:43:01 -07:00
Xavier Noria
a9dc45459a code gardening: removes redundant selfs
A few have been left for aesthetic reasons, but have made a pass
and removed most of them.

Note that if the method `foo` returns an array, `foo << 1`
is a regular push, nothing to do with assignments, so
no self required.
2016-08-08 01:12:38 +02:00
Ryuta Kamizono
762e3f05f3 Add Style/EmptyLines in .rubocop.yml and remove extra empty lines 2016-08-07 17:50:59 +09:00
Xavier Noria
b326e82dc0 applies remaining conventions across the project 2016-08-06 20:20:22 +02:00
Xavier Noria
80e66cc4d9 normalizes indentation and whitespace across the project 2016-08-06 20:16:27 +02:00
Xavier Noria
5b6eb1d58b modernizes hash syntax in actionpack 2016-08-06 19:35:13 +02:00
Xavier Noria
35b3de8021 applies new string literal convention in actionpack/test
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
2016-08-06 18:54:50 +02:00
eileencodes
af1680f51c Fix GET JSON integration test request to use method override
When a `GET` request is sent `as: :json` in an integration test the test
should use Rack's method override to change to a post request so the
paramters are included in the postdata. Otherwise it will not encode the
parameters correctly for the integration test.

Because integration test sets up it's own middleware,
`Rack::MethodOverride` needs to be included in the integration tests as
well.

`headers ||= {}` was moved so that headers are never nil. They should
default to a hash.

Fixes #26033

[Eileen M. Uchitelle & Aaron Patterson]
2016-08-05 15:43:39 -04:00
Jun Aruga
acf99bde03 Remove unused activerecord requirement in actionpack. 2016-07-11 16:06:37 +02:00
Jon Moss
81251c6d99 More Action Pack abstract_unit cleanup (#25211)
- Remove dead classes / dead code
- Move class definitions to where they are used, don't define in a
  shared space
2016-05-31 11:21:30 -04:00
Jon Moss
1fe7399fa9
Move Workshop class definition
We should define it only where we need it, not in the global abstract
unit 😬
2016-05-30 23:15:49 -04:00
Arthur Nogueira Neves
15c308582f Merge pull request #23932 from arthurnn/arthurnn/remove_load_paths
Remove load_paths file
2016-03-01 16:10:09 -05:00
Andrew White
6520ea5f7e Deprecate :controller and :action path parameters
Allowing :controller and :action values to be specified via the path
in config/routes.rb has been an underlying cause of a number of issues
in Rails that have resulted in security releases. In light of this it's
better that controllers and actions are explicitly whitelisted rather
than trying to blacklist or sanitize 'bad' values.
2016-03-01 08:48:53 +00:00
Arthur Neves
2abcdfd978 Remove load_paths file 2016-02-27 13:03:57 -05:00
Aaron Patterson
7b7b12f598 do not run in parallel on travis 2016-01-12 15:55:47 -08:00
Benjamin Fleischer
1c361ea356 Test ActionController::Renderers::use_renderers 2015-12-31 13:07:58 -06:00
Aaron Patterson
38d2bf5fd1 mostly remove the ParamsParser middleware
This can still be added to the middleware stack, but is really not
necessary.  I'll follow up with a commit that deprecates the constant
2015-09-18 15:36:55 -07:00
Marcin Olichwirowicz
81bc771e7c Remove mocha from ActionPack tests 2015-09-05 16:58:40 +02:00
Aaron Patterson
51c7ac142d provide a request and response to all controllers
Controllers should always have a request and response when responding.
Since we make this The Rule(tm), then controllers don't need to be
somewhere in limbo between "asking a response object for a rack
response" or "I, myself contain a rack response".  This duality leads to
conditionals spread through the codebase that we can delete:

  * 85a78d9358/actionpack/lib/action_controller/metal.rb (L221-L223)
2015-08-25 18:35:44 -07:00
Aaron Patterson
67b2841fbe adding a direct dispatch method to controller classes
This saves a lambda and request allocation on each request.
2015-08-25 16:25:52 -07:00
Kasper Timm Hansen
7ee60d4c5b Merge pull request #21368 from rodzyn/remove_mocha
Get rid of mocha tests in actionpack - part 2
2015-08-25 21:46:30 +02:00
Rafael Mendonça França
e84cc9afe4 Merge pull request #21345 from aditya-kapoor/trim-ap
Trim out least needed controllers from AP test suite
2015-08-25 12:44:34 -03:00
Marcin Olichwirowicz
00234f5619 Get rid of mocha tests - part 2 2015-08-25 09:28:06 +02:00
Aaron Patterson
7a62cc7d22 remove dead code 💣 2015-08-24 14:11:37 -07:00
Aaron Patterson
2237ee0596 subclass and delegate rather than mutating existing objects
If we subclass and augment the superclass, then we don't need to have
setters for particular things on the superclass.
2015-08-24 13:49:52 -07:00
Gaurav Sharma
a50872d51d temp files are no more require
`💅`
2015-08-25 01:36:05 +05:30
Aaron Patterson
337684fa28 use a custom request class to determine the controller class
controller class resolution has been moved to the request object, so we
should override that method instead of relying on the RouteSet to
generate the controller class.
2015-08-24 12:06:41 -07:00
Kasper Timm Hansen
b9825801e2 Merge pull request #21321 from rodzyn/removing_mocha
Get rid of mocha tests in actionpack - part 1
2015-08-24 12:44:01 +02:00
Marcin Olichwirowicz
3a161e65e7 Get rid of mocha tests - part 1 2015-08-24 12:24:07 +02:00
Aditya Kapoor
b393c6af92 Trim out unneeded controllers from AP test suite 2015-08-24 01:02:14 +05:30
eileencodes
4276b214f8 Refactor to remove controller class from route to request
This refactoring moves the controller class name that was on the route
set to the request. The purpose of this refactoring is for changes we
need to move controller tests to integration tests, mainly being able to
access the controller on the request instead of having to go through
the router.

[Eileen M. Uchitelle & Aaron Patterson]
2015-08-22 09:44:24 -04:00
Rafael Mendonça França
d919fd88ec Merge pull request #11352 from xaviershay/dispatcher-api
Allow a custom dispatcher to be provided to routing.
2015-08-08 12:22:21 -03:00
eileencodes
c8b8295583 Refactor to remove DrawOnce module
We were doing extra work that could be pushed off to Integration test
and SharedRoutes. Creating an extra module isn't necessary when those
are created by their respective classes.
2015-08-08 10:15:35 -04:00
Xavier Shay
2992b1c04c Allow a custom dispatcher to be provided to routing. 2015-08-07 20:06:24 -07:00
Aaron Patterson
83b767cef9 Using strings or symbols for middleware class names is deprecated.
Convert things like this:

  middleware.use "Foo::Bar"

to this:

  middleware.use Foo::Bar
2015-08-07 15:37:31 -07:00
Santiago Pastorino
032778eefb Add ActionController API functionality 2015-06-11 16:54:09 -03:00
Mehmet Emin İNAÇ
44781b6e97 Deprecate :nothing option for render method
`head` method works similar to `render` method with `:nothing` option
2015-05-28 15:13:32 +03:00
Toshi MARUYAMA
2a73b5999e wrap "require 'drb/unix'" by bgin-end at test/abstract_unit.rb
Related: #19617, #19187, #19533, #19689, #19675.

'drb/unix' does not exist on mingw.
2015-04-09 19:25:11 -03: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
Damien Mathieu
d578cbfb5c don't fallback to RACK_ENV when RAILS_ENV is not present 2015-03-19 10:06:28 +01:00
Guo Xiang Tan
dad40bf9ea Run ActionPack test cases in random order. 2015-03-06 00:24:22 +08:00
Robin Dupret
022c8be2cf Avoid parallelizing Action Pack's tests on Rubinius
Since the `ForkingExecutor` class seems to be pretty slow on Rubinius
due to DRb (c.f. http://git.io/xIVg), let's avoid running tests with
it on this platform.

Also, the `parallelize_me!` call make the suite to output a bunch of
errors due to rubinius/rubinius#2934 since there are thread-safety
problems with autoloading.
2015-03-02 14:05:07 +01:00
Thiago Pradi
3c181f66a3 Removing old helper that was necessary for compatibility with Ruby 1.8.x 2015-02-22 23:42:51 -03:00
Thiago Pradi
48a0995c7e Removing unused constants from abstract_unit 2015-02-22 23:42:50 -03:00