Commit Graph

289 Commits

Author SHA1 Message Date
Genadi Samokovarov
54df392bc5 Manage ActionDispatch::ActionableExceptions from the default middleware stack 2019-04-19 14:15:22 +09:00
Fumiaki MATSUSHIMA
61c4be4777 Output junit format test report 2019-04-04 14:34:46 +09:00
yuuji.yaginuma
4b5c4ca377 Use Testing::Parallelization in Action Packs's test
Parallel execution of `ForkingExecutor` is the same approach as
`Testing::Parallelization`. So do not need to have own code inside
Action Pack. Let's use an already existing feature.
2018-11-28 16:10:14 +09:00
schneems
235e734e1e Revert "Merge pull request #33970 from rails/eager-url-helpers"
Until #34050 can be resolved

This reverts commit 7f870a5ba2aa9177aa4a0e03a9d027928ba60e49, reversing
changes made to 6556898884d636c59baae008e42783b8d3e16440.
2018-10-03 16:15:47 -05:00
Aaron Patterson
8dc784292b
Eagerly build the routing helper module after routes are committed
This commit eagerly builds the route helper module after the routes have
been drawn and finalized.  This allows us to cache the helper module but
not have to worry about people accessing the module while route
definition is "in-flight", and automatically deals with cache
invalidation as the module is regenerated anytime someone redraws the
routes.

The restriction this commit introduces is that the url helper module can
only be accessed *after* the routes are done being drawn.

Refs #24554 and #32892
2018-09-25 09:43:25 -07:00
Aaron Patterson
6d698fdb07
Merge pull request #33973 from rails/remove-catch-all
Remove deprecated catch-all route in the AV tests
2018-09-25 09:27:37 -07:00
Aaron Patterson
4f96e739c2
Remove deprecated catch-all route in the AV tests
This commit removes a deprecated catch-all route in the AV tests.  It
defines and includes the necessary routes for each test such that we
don't need the catch-all anymore.

This also helps push us toward #33970
2018-09-24 15:39:15 -07:00
Sakshi Jain
0fe2bb816f Remove private def 2018-09-23 21:27:44 +05:30
Nobuyoshi Nakada
09820655f8
let drb make temprary server 2017-12-29 23:58:43 +09:00
yuuji.yaginuma
cc0d272c8c Generate tmpname on its own
`make_tmpname` was removed by 25d56ea7b7.
In this case, we want a file name, not a `File`. So cannot use `Tempfile`.

Fixes #31458
2017-12-15 11:57:43 +09:00
bogdanvlviv
82b974813b
Add headless firefox driver to System Tests 2017-12-07 20:20:54 +02:00
Shuhei Kitagawa
03dd47ff21 removed unnecessary semicolons 2017-10-28 17:39:58 +09:00
yuuji.yaginuma
ada05850f8 Add headless chrome driver to System Tests 2017-10-17 07:35:48 +09:00
Koichi ITO
d2901bd517 [Action Pack] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
Kir Shatrov
b3f3d49fd6 Prepare AP and AR to be frozen string friendly 2017-07-06 21:30:43 +03:00
Matthew Draper
87b3e226d6 Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"
This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing
changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
2017-07-02 02:15:17 +09:30
Kir Shatrov
cfade1ec7e Enforce frozen string in Rubocop 2017-07-01 02:11:03 +03:00
bogdanvlviv
40bdbce191
Define path with __dir__
".. with __dir__ we can restore order in the Universe." - by @fxn

Related to 5b8738c2df003a96f0e490c43559747618d10f5f
2017-05-23 00:53:51 +03:00
eileencodes
7c9af60e5c Call system test driver per-instance rather than globally
Previously the system test subclasses would call `driven_by` when the
app booted and not again when the test was initialized which resulted in
the driver from whichever class was called last to be used in tests.

In rails/rails#28144 the `driven_by` method was changed to run `use` on
setup and `reset` on teardown. While this was a viable fix this really
pointed to the problem that system test `driven_by` was a global
setting, rather than a per-class setting.

To alieviate this problem calling the driver should be done on an
instance level, rather than on the global level. I added an `initialize`
method to `SystemTestCase` which will call `use` on the superclass
driver. Running the server has been moved to `start_application` so that
it only needs to be called once on boot and no options from `driven_by`
were being passed to it.

This required a largish rewrite of the tests. Each test needs to utilize
the subclass so that it can properly test the drivers.
`ActionDispatch::SystemTestCase` shouldn't be called directly anymore.
2017-03-09 10:52:05 -05:00
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