Commit Graph

234 Commits

Author SHA1 Message Date
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
Thiago Pradi
2b88f65061 Removing unused controller from abstract_unit 2015-02-22 23:42:50 -03:00
Rafael Mendonça França
921576b1d9 Merge pull request #17862 from lucasmazza/lm-hide-action
`_generate_paths_by_default` should always be private.
2014-12-02 11:40:11 -02:00
Erik Michaels-Ober
d1374f99bf Pass symbol as an argument instead of a block 2014-11-29 11:53:24 +01:00
Guo Xiang Tan
76f5a9afb3 Remove session to allow with_routing to be called twice.
Fixes: https://github.com/rails/rails/issues/16814
2014-11-05 23:38:02 +08:00
Godfrey Chan
2b41343c34 Default to sorting user's test cases for now
Goals:

1. Default to :random for newly generated applications
2. Default to :sorted for existing applications with a warning
3. Only show the warning once
4. Only show the warning if the app actually uses AS::TestCase

Fixes #16769
2014-09-08 05:32:16 -07:00
Matthew Draper
2f52f96988 Leave all our tests as order_dependent! for now
We're seeing too many failures to believe otherwise.

This reverts commits bc116a55ca3dd9f63a1f1ca7ade3623885adcc57,
cbde413df3839e06dd14e3c220e9800af91e83ab,
bf0a67931dd8e58f6f878b9510ae818ae1f29a3a, and
2440933fe2c27b27bcafcd9019717800db2641aa.
2014-09-02 23:55:34 +09:30
Agis-
b7ab73a4e2 Use system /tmp when testing actionpack
c64bff2c87
added support and enabled parallel execution of the actionpack tests.

However it introduced c64bff2c87
since one cannot connect to a socket file that's inside a Vagrant synced folder
due to security restrictions, and DRb tries to.

Also rename the temporary files to make it obvious that they're rails-related,
since now they're placed outside the project's directory.

Fixes c64bff2c87
2014-08-22 22:03:41 +03:00
Aaron Patterson
efb835c9c0 UnexpectedErrors may reference exceptions that can't be dumped
UnexpectedError exceptions wrap the original exception, and the original
exception may contain a reference to something that can't be marshal
dumped which will cause the process to die.
2014-08-13 14:22:49 -07:00
Akira Matsuda
bc116a55ca AM, AP, AV, and AMo tests are already order_independent! 2014-08-13 21:25:10 +09:00
Rafael Mendonça França
e81f3c210e Nobody sucks so nobody should call this awful method name 2014-08-12 10:51:41 -03:00
Akira Matsuda
6ffb29d24e users_dont_suck_but_only_we_suck_and_only_our_tests_are_order_dependent!
Calling ActiveSupport::TestCase.i_suck_and_my_tests_are_order_dependent! in AS::TestCase makes
everyone's tests order dependent, which should never be done by the framework.
2014-08-12 19:37:04 +09:00
Rafael Mendonça França
decb83b9fd Use PROCESS_COUNT to define the number of parallel executors 2014-07-23 14:40:43 -03:00
Aaron Patterson
0b773c30fb specify N=0 to prevent parallel tests (just run tests on the main process) 2014-07-23 10:38:52 -07:00
Rafael Mendonça França
08754f12e6 Merge branch 'rm-remove-mocha'
Conflicts:
	actionpack/test/abstract_unit.rb
2014-07-19 18:17:13 -03:00
Rafael Mendonça França
fd6aaaa0c3 Stop requiring mocha automatically
We are planning to remove mocha from our test suite because of
performance problems. To make this possible we should stop require mocha
on ActionSupport::TestCase.

This should not affect applications since users still need to add mocha
to Gemfile and this already load mocha.

Added FIXME notes to place that still need mocha removal
2014-07-19 17:35:12 -03:00
Aaron Patterson
d4c8068675 reporting is only done in one thread, so we can safely remove the lock
(I think)
2014-07-17 18:43:46 -07:00
Aaron Patterson
5751b7ea58 pass the test reporter by reference
this prevents the array from being dumped as a DRbObject so we can
reduce communication with the server.  the reporter should always exist
on the server side, so we don't have to worry about GC
2014-07-17 14:45:30 -07:00
Aaron Patterson
8d126c9424 do not restart the service, just stop it 2014-07-17 14:04:55 -07:00
Aaron Patterson
d548a36c8f only parallelize on forking systems 2014-07-17 14:04:55 -07:00
Aaron Patterson
c64bff2c87 [EXPERIMENTAL] run actionpack tests in parallel
only on forking systems though.  Feel free to revert this if it causes
problems.
2014-07-17 12:08:41 -07:00
Aaron Patterson
212057b912 pass the route name to define_url_helper
this allows us to avoid 2 hash allocations per named helper definition,
also we can avoid a `merge` and `delete`.
2014-07-17 11:21:17 -07:00
Aaron Patterson
7880f39e1d Fix 1.9. uggghhhhhh get it together @tenderlove 💣 2014-07-15 18:43:47 -07:00
Aaron Patterson
993ca82d70 fix for 1.9 kwargs syntax 2014-07-15 18:20:50 -07:00
Aaron Patterson
f3c1832ad4 stop passing recall to url_for 2014-07-15 15:53:00 -07:00
Aaron Patterson
3ef98a1439 fix warnings 2014-07-15 15:24:23 -07:00
Aaron Patterson
8eb7bcb6e5 stop calling url_for with recall parameters and actually use a request 2014-07-15 15:19:41 -07:00
Matthew Draper
29f8eae3fa Merge pull request #15061 from tgxworld/remove_unnecessary_include
Remove unnecessary include for integration tests.
2014-05-29 21:33:12 +09:30
Aaron Patterson
348af15c33 _recall should be set to a hash or not set
Then we can avoid nil checks
2014-05-13 17:21:55 -07:00
Guo Xiang Tan
da290fae09 Remove unnecessary include for integration tests. 2014-05-11 16:02:12 -07:00
Gaurish Sharma
35e56f6fa5 standardize on jruby_skip & rbx_skip
This Adds helpers(jruby_skip & rbx_skip). In Future, Plan is to use
these helpers instead of calls directly to
RUBY_ENGINE/RbConfig/JRUBY_VERSION
2014-01-13 19:51:47 +05:30
Akira Matsuda
ccc1a7b7b0 Unused classes in AP tests 2013-12-25 18:10:56 +09:00
Carlos Antonio da Silva
6802196a6b Disable available locales checks to avoid warnings running the tests 2013-12-17 09:05:41 -02:00
Carlos Antonio da Silva
d6eda3ef3c Remove missing integration points of AV extraction 2013-12-05 11:39:56 +01:00
Łukasz Strzałkowski
21c5f2845d Remove RenderERBUtils from AP (only AV use it) 2013-08-25 11:39:10 +02:00
Łukasz Strzałkowski
37d77f6b9d Remove AV::TestCase from AP 2013-08-25 11:39:10 +02:00
Łukasz Strzałkowski
3fd2e72477 Load AV::Layouts dynamicly via railties 2013-08-25 11:39:10 +02:00