Łukasz Strzałkowski
8e3413d410
Create AbstractController::Rendering interface
...
This interface should be use when implementing renderers.
2013-08-25 11:39:09 +02:00
Łukasz Strzałkowski
8c2c95e5d2
Fix AP test suite after moving stuff to AV
2013-08-25 11:39:08 +02:00
Vipul A M
f23e7eba52
remove unused variable and assignment
2013-03-31 19:34:40 +05:30
Akira Matsuda + Koichi Sasada
b7b27fc2a3
Set Thread.abort_on_exception for the whole AS, AP, and AR tests
...
this would give us some more clues in case a test silently dies inside Thread
2013-01-24 20:00:45 +09:00
Rafael Mendonça França
5da4d5142a
Add active_support/testing/autorun
...
minitest/autorun load minitest/spec polluting the global namespace with
the DSL that we don't want on Rails
2012-12-31 13:57:24 -03:00
Rafael Mendonça França
ccecab3ba9
Remove observers and sweepers
...
They was extracted from a plugin.
See https://github.com/rails/rails-observers
[Rafael Mendonça França + Steve Klabnik]
2012-11-28 22:46:49 -02:00
Rafael Mendonça França
d0c25f253f
Define a SynchronousQueue for test in Action Pack.
...
We don't need to rely on rails/queueing in Action Pack tests
2012-09-12 15:33:42 -03:00
Arun Agrawal
a28efd8ac6
Fix build Rails.queue
...
see 34b23e7110a3a13cf157608cefc9b5701017bf39
2012-09-12 09:50:16 +05:30
Ernie Miller
4037e31d88
Allow routing concerns to accept a callable
...
This allows us to make alterations to the generated routes based on the
scope of the current mapper, and otherwise allows us to move larger
blocks of concerns out of the routes file, altogether.
2012-09-03 13:13:16 -04:00
Rafael Mendonça França
546497d027
Extract common controllers to abstract_unit
2012-08-13 21:43:18 -03:00
Aaron Patterson
c63d17c2be
push drawing once to it's own module
2012-08-09 14:50:27 -07:00
Aaron Patterson
1e8c0a29d0
refactor the before_setup hooks to a module
2012-08-09 14:50:26 -07:00
Aaron Patterson
0b29c7bb7b
switch callbacks to minitest hooks
2012-08-09 14:50:26 -07:00
Bogdan Gusiev
d89161e7cc
Renamed _path_segments to _recall
2012-08-04 14:55:00 +03:00
Santiago Pastorino
449039a86d
Remove ActionDispatch::Head middleware in favor of Rack::Head
...
Closes #7110 there's more work to do on rack-cache issue 69
2012-07-23 14:34:13 -03:00
Piotr Sarnacki
60b4290f1b
Allow to use mounted helpers in ActionView::TestCase
...
Similarly to 6525002, this allows to use routes helpers for mounted
helpers, but this time in ActionView::TestCase
2012-06-01 17:45:06 +02:00
Santiago Pastorino
36dd1857dc
Remove useless load path modifications
2012-05-11 19:00:35 -03:00
Jose and Yehuda
56cdc81c08
Remove default match without specified method
...
In the current router DSL, using the +match+ DSL
method will match all verbs for the path to the
specified endpoint.
In the vast majority of cases, people are
currently using +match+ when they actually mean
+get+. This introduces security implications.
This commit disallows calling +match+ without
an HTTP verb constraint by default. To explicitly
match all verbs, this commit also adds a
:via => :all option to +match+.
Closes #5964
2012-04-24 22:52:26 -05:00
José Valim
6db930cb5b
Remove --http.
2012-03-14 22:30:01 +01:00
Santiago Pastorino
4c16791f35
Add ActionController::HTTP
...
More info http://edgeguides.rubyonrails.org/api_app.html
[Carlos Antonio da Silva & Santiago Pastorino]
2012-03-14 12:46:23 -03:00
Aaron Patterson
bce3b5cb72
moved the get
testing method to a module
2012-01-23 10:18:36 -08:00
Aaron Patterson
b15d2c0708
require minitest rather than test/unit
2012-01-06 15:50:47 -08:00
Rafael Mendonça França
2ed17977ac
Change more Array.wrap to Kernel#Array
2012-01-05 17:57:56 -03:00
Sergey Nartimov
5ca86ac8f9
deprecate String#encoding_aware? and remove its usage
2011-12-24 15:57:54 +03:00
José Valim
deef8dd682
Extract the rendering of public exceptions pages into a Rack app.
2011-12-16 10:45:59 +01:00
José Valim
750bb5c865
Split ShowExceptions responsibilities in two middlewares.
2011-12-01 20:46:18 +01:00
lest
565d92f578
fix method redefined warnings in tests
2011-11-30 18:57:12 +03:00
lest
a985309abc
fix warning in tests when using render_erb helper
2011-11-30 18:05:23 +03:00
lest
e975fe710a
test helpers in erb using erb
2011-11-30 17:38:09 +03:00
lest
cd9d28d6fd
middlewares should use logger from env
2011-11-25 13:09:46 +03:00
Santiago Pastorino
e5f2b0d75f
Revert "Merge pull request #2647 from dmathieu/no_rescue"
...
This reverts commit 125b1b0b9180ec8f0135da185e77250d2b8a4bea.
2011-08-30 20:52:08 -03:00
Damien Mathieu
13dd7758ce
remove useless rescue
...
params is a method, defined in every controller, which always returns a hash.
If it raises a NoMethodError, it means there's a bug somewhere else, which we want to know about.
2011-08-24 09:52:00 +02:00
Prem Sichanugrist
1bbc51e5a7
Fix failing test on uninitialized Rails.config.assets.prefix
...
This was introduced in [2684f17a17e4f97bdb89d20b4cd08585235263a2] 💣
2011-06-08 02:30:50 -04:00
Arun Agrawal
531095e64e
We don't need to load version any more as Sprockets.beta8 is included.
2011-05-23 07:09:09 +05:30
Prem Sichanugrist
90f028a4dc
Make sure that we're able to run Action Pack test standalone.
...
Sprocket was trying to look for these two things:
* `Rails::VERSION::STRING`
* `.initializer(str)` in `Rails::Engine`
This commit added require to version.rb into Abstract Unit, and mocking the `Rails::Engine.initializer` in `sprockets_helper_test.rb`
2011-05-22 19:02:54 -04:00
Aaron Patterson
938243feb9
do not require ruby-debug automatically. please require it if you have declared it as a dependency
2010-11-19 16:26:09 -08:00
Andrew White
2d5a12a50b
Don't write out secure cookies unless the request is secure
2010-10-25 16:36:35 +01:00
Aaron Patterson
ffbcb84c21
removing more duplicate code
2010-10-01 18:05:59 -07:00
Aaron Patterson
44f85678e9
delete repeated code
2010-10-01 18:01:34 -07:00
Carlos Antonio da Silva
7fc1edd790
Remove deprecated stuff in ActionController
...
This removes all deprecated classes in ActionController related to
Routing, Abstract Request/Response and Integration/IntegrationTest.
All tests and docs were changed to ActionDispatch instead of ActionController.
2010-09-26 02:13:45 +08:00
Carlos Antonio da Silva
ff3f55ee58
There is no need to open AC::Base three times to setup tests.
2010-09-26 02:13:44 +08:00
Łukasz Strzałkowski
aac390204a
Revert "Extended default route for match in tests - now it matches controller, action, id and format if given."
...
This reverts commit 05e9d0df0dea68ca4655aa8723c3ee69049fac78.
2010-09-05 13:44:36 +02:00
Łukasz Strzałkowski
7ff8a2040e
Extended default route for match in tests - now it matches controller, action, id and format if given.
...
This fixes url_for tests
2010-09-05 13:44:36 +02:00
Piotr Sarnacki
b3eb26a161
Removed deprecated RouteSet API, still many tests fail
2010-09-05 13:44:36 +02:00
Santiago Pastorino
8d1ee434da
Silence warnings for Encoding.default_external= and Encoding.default_internal=
2010-08-22 18:43:31 -03:00
Santiago Pastorino
1d888d465b
Move encoding settings for testing purposes to abstract_unit file
2010-08-21 22:37:53 -03:00
Santiago Pastorino
b451de0d6d
Deletes trailing whitespaces (over text files only find * -type f -exec sed 's/[ \t]*$//' -i {} \;)
2010-08-14 04:12:33 -03:00
José Valim
9e6e648732
Fix routes with :controller segment when namespaced [ #5034 state:resolved]
2010-07-02 19:13:00 +02:00
Piotr Sarnacki
f7ba614c2d
Unify routes naming by renaming router to routes
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-07-02 01:51:03 +02:00
José Valim
6d04fa6dc4
Deprecate the old router DSL. Since it is still used intensively across ActionPack test suite, patches that translates Rails internal tests to the new router DSL are welcome (note though that a few tests shouldn't be translated since they are testing exactly the old mapper API, like the ones in actionpack/test/controller/resource_test.rb and actionpack/test/controller/routing_test.rb)
2010-06-28 12:23:41 +02:00
Santiago Pastorino
824da60ae8
Move Rails module to abstract_unit to make test in isolation work
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-28 01:26:07 +02:00
Michael Lovitt
ebee77a28a
Fixed that an ArgumentError is thrown when request.session_options[:id] is read in the following scenario: when the cookie store is used, and the session contains a serialized object of an unloaded class, and no session data accesses have occurred yet. Pushed the stale_session_check responsibility out of the SessionHash and down into the session store, closer to where the deserialization actually occurs. Added some test coverage for this case and others related to deserialization of unloaded types.
...
[#4938 ]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-27 22:39:06 +02:00
Neeraj Singh
db23a95a61
cache_sweeper yields blank output
...
[#3914 state:open]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-08 23:20:04 +02:00
José Valim
25f7c030e4
Simplify cookie_store by simply relying on cookies.signed.
2010-05-18 02:05:20 +02:00
wycats
80b60671f7
Revert "Moved encoding work in progress to a feature branch."
...
This reverts commit ade756fe42423033bae8e5aea8f58782f7a6c517.
2010-05-17 19:41:54 +04:00
Jeremy Kemper
ade756fe42
Moved encoding work in progress to a feature branch.
...
This reverts commits af0d1a88157942c6e6398dbf73891cff1e152405 and 64d109e3539ad600f58536d3ecabd2f87b67fd1c.
2010-05-16 13:55:29 -07:00
wycats
64d109e353
Significantly improved internal encoding heuristics and support.
...
* Default Encoding.default_internal to UTF-8
* Eliminated the use of file-wide magic comments to coerce code evaluated inside the file
* Read templates as BINARY, use default_external or template-wide magic comments
inside the Template to set the initial encoding
* This means that template handlers in Ruby 1.9 will receive Strings encoded
in default_internal (UTF-8 by default)
* Create a better Exception for encoding issues, and use it when the template
source has bytes that are not compatible with the specified encoding
* Allow template handlers to opt-into handling BINARY. If they do so, they
need to do some of their own manual encoding work
* Added a "Configuration Gotchas" section to the intro Rails Guide instructing
users to use UTF-8 for everything
* Use config.encoding= in Ruby 1.8, and raise if a value that is an invalid
$KCODE value is used
Also:
* Fixed a few tests that were assert() rather than assert_equal() and
were caught by Minitest requiring a String for the message
* Fixed a test where an assert_select was misformed, also caught by
Minitest being more restrictive
* Fixed a test where a Rack response was returning a String rather
than an Enumerable
2010-05-16 22:44:43 +04:00
David Chelimsky
91125f9927
move FixtureResolver to a file that is accessible outside Rails' own tests
...
[#4522 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-02 22:45:54 +02:00
Santiago Pastorino
ed0ca5db9e
Add a test for assert_recognizes on ActionDispatch::IntegrationTest [ #4390 state:committed]
...
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-04-24 15:43:12 -07:00
José Valim
6690d66292
Rename config.cookie_secret to config.secret_token and pass it as configuration in request.env. This is another step forward removing global configuration.
2010-04-05 12:00:24 +02:00
wycats
3eb97531b8
Refactored url_for in AV to have its own instances of the helpers instead of proxying back to the controller. This potentially allows for more standalone usage of AV. It also kicked up a lot of dust in the tests, which were mocking out controllers to get this behavior. By moving it to the view, it made a lot of the tests more standalone (a win)
2010-04-03 02:44:02 -07:00
Joshua Peek
cdf8c35ffd
Consistent routing language
2010-03-30 14:05:42 -05:00
wycats
e1c030edd8
Fixed a bunch of tests that failed in 1.9 because they assumed that a Rack response was a String.
2010-03-19 18:46:29 -07:00
Carlhuda
947f86c699
Modify assert_template to use instrumentation
2010-03-17 14:29:18 -07:00
wycats
39d6f9e112
Make many parts of Rails lazy. In order to facilitate this,
...
add lazy_load_hooks.rb, which allows us to declare code that
should be run at some later time. For instance, this allows
us to defer requiring ActiveRecord::Base at boot time purely
to apply configuration. Instead, we register a hook that should
apply configuration once ActiveRecord::Base is loaded.
With these changes, brings down total boot time of a
new app to 300ms in production and 400ms in dev.
TODO: rename base_hook
2010-03-07 06:24:30 -08:00
Carlhuda
e311622e7b
Deprecated ActionController::Base.session_options= and ActionController::Base.session_store= in favor of a config.session_store method (which takes params) and a config.cookie_secret variable, which is used in various secret scenarios. The old AC::Base options will continue to work with deprecation warnings.
2010-03-04 16:05:52 -08:00
Carl Lerche
1f0f05b10c
Move the original config method onto AbstractController
2010-03-03 21:24:27 -08:00
Carlhuda
b160663bd1
Start refactoring the method of configuring ActionView
2010-03-03 21:24:01 -08:00
Carlhuda
d78e3fe73f
Fix failing Action Pack tests
2010-03-02 14:41:12 -08:00
Joshua Peek
cbefcc88b3
add activesupport and activemodel load paths to actionpack tests
2010-02-28 18:25:02 -06:00
Joshua Peek
7317d9ef4c
Remove implicit controller namespacing from new dsl
2010-02-28 16:39:01 -06:00
Carlhuda
050831803a
If IntegrationSession is initialized with an objects that responds to #routes, automatically extend the URL helpers from the RouteSet onto it
2010-02-26 17:18:45 -08:00
Carlhuda
be0bf10a3c
Upon further reflection, we realized that SharedTestRoutes is not really a hack, but is instead a standin (in the Rails tests) for Rails.application.routes.
...
* In a real application, action_controller/railties.rb does AC::Base.include(app.routes.url_helpers)
* ActionController itself does not know about Rails.application, but instead can have named routes for any router
* SharedTestRoutes are created in abstract_unit to stand in for Rails.application.routes, and is used in
internal functional tests
2010-02-26 16:06:54 -08:00
Carlhuda
74df7795a8
Relatively speaking, it's not actually that bad...
2010-02-26 15:58:24 -08:00
Carlhuda
3bad24c85d
Remove traces of SharedTestRoutes from user code; leave it as a standin for Rails.application.routes in Rails internal tests
2010-02-26 15:44:22 -08:00
Carlhuda
5797575bac
Stop setting UrlFor using SharedTestHelpers
2010-02-26 15:40:36 -08:00
Carlhuda
98f77e0827
Rename named_url_helpers to url_helpers and url_helpers to url_for
2010-02-26 15:04:50 -08:00
Carlhuda
226dfc2681
WIP: Remove the global router
2010-02-25 17:53:00 -08:00
Carlhuda
24ab5665b2
Revert "Fix test load paths for those not using bundler"
...
This reverts commit eec2d301d4ce9df9c71c1a5aa63053eb970b6818.
This commit broke tests. You cannot have a file called "bundler" on the load path.
2010-02-23 17:31:17 -08:00
Martin Schürrer
6bc24d40d5
Use ActionDispatch::Routing everywhere
2010-02-21 13:43:51 -08:00
Joshua Peek
eec2d301d4
Fix test load paths for those not using bundler
2010-02-15 10:20:11 -06:00
Carl Lerche
9f01dff9c2
Get rails tests running on bundler 0.9
2010-01-31 19:13:43 -08:00
Joshua Peek
d2d4acf027
Cookies middleware
2010-01-16 17:22:27 -06:00
Joshua Peek
ead93c5be5
Move Flash into middleware
2010-01-15 14:55:13 -06:00
Joshua Peek
3eaf525213
Make HEAD method masquerade as GET so requests are routed correctly
2010-01-15 12:38:50 -06:00
José Valim
da5978c223
Add subscriber for ActionPack and move all logging inside it.
2010-01-13 01:19:23 +01:00
Joshua Peek
3f28e0bda6
Trash string coercion rack hacks
2010-01-04 19:46:21 -06:00
Joshua Peek
2601a16ede
Autoload AS test case
2010-01-04 16:22:46 -06:00
Joshua Peek
cf83a6f16b
Autoload AC and AV test case classes
2010-01-04 16:22:46 -06:00
José Valim
6fbe9ef2ff
Use namespaces in notifications.
2010-01-03 20:39:42 +01:00
José Valim
75ba102a80
Remove ActionView inline logging to ActiveSupport::Notifications and create ActionController::Base#log_event, so everything can be logged within one listener. Also expose log_process_action as a hook for different modules to include their own information during the action processing. This allow ActiveRecord to hook and any other ORM. Finally, this commit changes 'Processing' and 'Rendering' in logs to 'Processed' and 'Rendered' because at the point it's logged, everying already happened.
2009-12-26 20:28:53 +01:00
Joshua Peek
7ee5843c3c
Fully expand relative rails framework paths and make sure we aren't
...
adding any to the load path more than once.
2009-12-16 11:56:51 -06:00
Joshua Peek
ee395fe626
TestProcess belongs in AD
2009-12-12 18:09:44 -06:00
Joshua Peek
2be5e088d2
Use new routing dsl in tests
2009-12-08 16:52:26 -06:00
Joshua Peek
15ab3a98a1
Find all controllers in memory to use for routing
2009-11-23 20:20:50 -06:00
Joshua Peek
11e798ae0f
Avoid adding component lib/ to load path multiple times
2009-11-09 23:28:36 -06:00
Joshua Peek
23229d5ad4
Remove preflight lib check during AP tests. Bundler resolves this issue
2009-11-09 22:59:30 -06:00
Joshua Peek
a31ecff554
Don't warn me if I'm not using bundler to run tests
2009-11-09 22:51:48 -06:00
Jeremy Kemper
0ac88af998
Remark when bundled env require fails
2009-11-09 16:10:37 -08:00
Joshua Peek
43e0bc1c9f
Extract routing controller stub helper into abstract unit
2009-10-27 21:02:20 -05:00