Commit Graph

40 Commits

Author SHA1 Message Date
Jeremy Kemper
425a02cece Ruby 1.9: resolve constant lookup issues 2009-11-04 15:41:50 -08:00
Joshua Peek
a5c82a9dfb Start rewriting some internal tests to use the new routing dsl 2009-10-20 16:03:55 -05:00
Yehuda Katz
c44d560145 Rack responses need to wrap Strings in 1.9 2009-10-15 16:37:27 -07:00
Joshua Peek
84e94551f6 Add custom "with_routing" to internal tests to fix reseting session after using
with_routing. This only affects our internal AP tests.
2009-10-03 20:45:49 -05:00
Joshua Peek
acfeec5151 Allow integration test rack app to be set with "@app" ivar instead of using open_session 2009-09-26 20:51:05 -05:00
Joshua Peek
52aeb8d2e7 Beef up AD::Rescue to replace global exception handling lost in ApplicationController 2009-09-15 16:33:15 -05:00
Joshua Peek
90d7ae23c6 Remove global exception catching from ApplicationController.
It was severely broken since it was ported to NewBase and is causing problems with normal exception catching. A replacement is coming soon.
2009-09-15 10:05:46 -05:00
Joshua Peek
a3fcfd819b Need to reset session for AP rescue tests after altering the route set 2009-09-13 17:52:33 -05:00
Joshua Peek
8118fca9be Merge Failsafe middleware into ShowExceptions 2009-05-17 12:24:59 -05:00
Joshua Peek
11af089cee Extract ActionController rescue templates into Rescue and ShowExceptions middleware.
This commit breaks all exception catching plugins like ExceptionNotifier. These plugins should be rewritten as middleware instead overriding Controller#rescue_action_in_public.
2009-05-02 23:02:22 -05:00
Joshua Peek
380431e4ed Fix test_rescue_routing_exceptions when running with rake 2009-04-21 21:11:23 -05:00
Joshua Peek
0b92bb97c1 refactor some coupled rescue tests 2009-04-21 20:41:31 -05:00
Carl Lerche & Yehuda Katz
906aebceed Bring abstract_controller up to date with rails/master
Resolved all the conflicts since 2.3.0 -> HEAD. Following is a list
of commits that could not be applied cleanly or are obviated with the
abstract_controller refactor. They all need to be revisited to ensure
that fixes made in 2.3 do not reappear in 3.0:

2259ecf368e6a6715966f69216e3ee86bf1a82a7
AR not available
  * This will be reimplemented with ActionORM or equivalent

06182ea02e92afad579998aa80144588e8865ac3
implicitly rendering a js response should not use the default layout
[#1844 state:resolved]
  * This will be handled generically

893e9eb99504705419ad6edac14d00e71cef5f12
Improve view rendering performance in development mode and reinstate
template recompiling in production [#1909 state:resolved]
  * We will need to reimplement rails-dev-boost on top of the refactor;
    the changes here are very implementation specific and cannot be
    cleanly applied. The following commits are implicated:

      199e750d46c04970b5e7684998d09405648ecbd4
      3942cb406e1d5db0ac00e03153809cc8dc4cc4db
      f8ea9f85d4f1e3e6f3b5d895bef6b013aa4b0690
      e3b166aab37ddc2fbab030b146eb61713b91bf55
      ae9f258e03c9fd5088da12c1c6cd216cc89a01f7
      44423126c6f6133a1d9cf1d0832b527e8711d40f

0cb020b4d6d838025859bd60fb8151c8e21b8e84
workaround for picking layouts based on wrong view_paths
[#1974 state:resolved]
  * The specifics of this commit no longer apply. Since it is a two-line
    commit, we will reimplement this change.

8c5cc66a831aadb159f3daaffa4208064c30af0e
make action_controller/layouts pick templates from the current instance's
view_paths instead of the class view_paths [#1974 state:resolved]
  * This does not apply at all. It should be trivial to apply the feature
    to the reimplemented ActionController::Base.

87e8b162463f13bd50d27398f020769460a770e3
fix HTML fallback for explicit templates [#2052 state:resolved]
  * There were a number of patches related to this that simply compounded
    each other. Basically none of them apply cleanly, and the underlying
    issue needs to be revisited. After discussing the underlying problem
    with Koz, we will defer these fixes for further discussion.
2009-04-13 15:18:45 -07:00
Yehuda Katz and Carl Lerche
6c05b5e938 Temporarily modifies setup to call super directly. This can support more T::U runners. 2009-04-08 17:33:41 -07:00
José Valim
24f2e676f7 Added support to dashed locales in templates localization [#1888 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-02-06 23:23:50 -06:00
Jeremy Kemper
278186534c Bump mocha requirement for Ruby 1.9 compat. Remove uses_mocha. 2009-02-03 18:40:22 -08:00
José Valim
2ecc678ed6 Added localized rescue (404.da.html) [#1835 state:committed]
Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
2009-02-02 17:56:22 +01:00
Joshua Peek
319ae4628f Move HTTP libs and middleware into ActionDispatch component 2009-01-27 18:54:01 -06:00
Joshua Peek
f00e86d7e9 Memoize request accessors on the Rack env so other request objects have access to the same cache [#1668 state:resolved] 2009-01-04 12:15:15 -06:00
Laszlo Bacsi
606176a55b Fixed call_with_exception for Routing Errors [#1684 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-01-02 10:46:48 -06:00
Jeremy Kemper
2e1132fad8 Test that exceptions raised in filters are properly rescued 2008-12-30 18:06:56 -08:00
Joshua Peek
5d89605c11 Make router and controller classes better rack citizens 2008-12-28 15:31:03 -06:00
David Heinemeier Hansson
f42c77f927 Added ActiveSupport::BacktraceCleaner and Rails::BacktraceCleaner for cutting down on backtrace noise (inspired by the Thoughtbot Quiet Backtrace plugin) [DHH] 2008-11-22 18:06:08 +01:00
Pratik Naik
5e3517ea7b Ensure rescue_from handlers are respected inside tests. [#835 state:resolved]
Note : If you're not using rescue_from, you should overrider rescue_action_without_handler() method
and not rescue_action(). Afterwards, you can set request.remote_addr to a non "0.0.0.0" value for testing the
overridden behavior.
2008-10-04 18:43:46 +01:00
Pratik Naik
90c930f45c Allow Dispatcher exceptions to be handled in application.rb using rescue_from 2008-07-16 18:54:08 +01:00
Pratik Naik
ef4c65088f Move missing template logic to ActionView 2008-04-19 18:59:13 +01:00
David Heinemeier Hansson
420c4b3d88 Added Rails.public_path to control where HTML and assets are expected to be loaded from (defaults to Rails.root + "/public") #11581 [nicksieger] 2008-04-13 17:33:27 -05:00
Jeremy Kemper
9d755f1983 require abstract_unit directly since test is in load path
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8564 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-05 13:32:06 +00:00
Michael Koziarski
788ece4799 Make rescue_from behave like rescue when dealing with subclasses. Closes #10079 [fxn]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8081 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-06 06:02:24 +00:00
Jeremy Kemper
4db4661a67 rescue_from accepts :with => lambda { |exception| ... } or a normal block. Closes #9827.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7822 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-10 02:34:42 +00:00
Jeremy Kemper
a6f49d9b78 Introduce ActionController::Base.rescue_from to declare exception-handling methods. Cleaner style than the case-heavy rescue_action_in_public. Closes #9449.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7597 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-23 21:56:22 +00:00
Michael Koziarski
d4d4a08f6b Make sure missing template exceptions actually say which template they were looking for. Closes #8683 [dasil003]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7181 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-07-11 23:32:02 +00:00
Jeremy Kemper
dcaa074abf Routing: respond with 405 Method Not Allowed status when the route path matches but the HTTP method does not. Closes #6953.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6862 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-26 20:07:34 +00:00
David Heinemeier Hansson
e105653066 Added .erb and .builder as preferred aliases to the now deprecated .rhtml and .rxml extensions [Chad Fowler]. This is done to separate the renderer from the mime type. .erb templates are often used to render emails, atom, csv, whatever. So labeling them .rhtml doesn't make too much sense. The same goes for .rxml, which can be used to build everything from HTML to Atom to whatever. .rhtml and .rxml will continue to work until Rails 3.0, though. So this is a slow phasing out. All generators and examples will start using the new aliases, though.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6178 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-20 22:09:12 +00:00
Jeremy Kemper
d38417fc02 RecordInvalid, RecordNotSaved => 422 Unprocessable Entity, StaleObjectError => 409 Conflict. References #7097.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5966 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-17 00:43:53 +00:00
Jeremy Kemper
a6e12c0c21 Wrap and skip tests using mocha.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5926 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-14 12:49:55 +00:00
Jeremy Kemper
ba814a9033 Use mocha for rescue tests.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5916 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-13 07:14:46 +00:00
Jeremy Kemper
a1ca37ec86 Use 400 Bad Request status for unrescued ActiveRecord::RecordInvalid exceptions.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5771 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-22 00:27:39 +00:00
Jeremy Kemper
a454dcf012 Unrescued ActiveRecord::RecordNotFound responds with 404 instead of 500.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5706 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-08 22:19:00 +00:00
Jeremy Kemper
f0753992ab test controller rescues
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5504 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-13 02:03:50 +00:00