Commit Graph

1529 Commits

Author SHA1 Message Date
Carl Lerche
18bcce596e ActionController::Base.use_accept_header is not actually used anymore, so let's deprecate it. 2010-03-03 21:24:00 -08:00
Carl Lerche
fb14b8c6fd ActionDispatch::Request deprecates #request_uri
* Refactored ActionPatch to use fullpath instead
2010-03-03 21:24:00 -08:00
Carl Lerche
eb49bd6949 Fix tests for the request refactor 2010-03-03 21:24:00 -08:00
Carlhuda
5e0a05b8cb Tweak the semantic of various URL related methods of ActionDispatch::Request 2010-03-03 21:23:34 -08:00
Carlhuda
bcfb77782b Work on deprecating ActionController::Base.relative_url_root 2010-03-03 15:49:52 -08:00
Carlhuda
bf9913f8f4 Move session_store and session_options to the AC configuration object 2010-03-03 15:49:52 -08:00
Carlhuda
d78e3fe73f Fix failing Action Pack tests 2010-03-02 14:41:12 -08:00
Jeremy Kemper
9f83cdc38e No longer add missing leading / on path args to assert_redirected_to. Deprecated in 2.3.6. 2010-03-02 14:16:25 -08:00
Jeremy Kemper
ecfd6d90ee Action Mailer setup obviated by test bundle 2010-03-02 13:54:59 -08:00
Joshua Peek
7317d9ef4c Remove implicit controller namespacing from new dsl 2010-02-28 16:39:01 -06:00
Carlhuda
4bdc783d37 1.9 seems to have a bug involving cloned classes and super. Fix it by not cloning (and instead creating classes on demand). The 1.9 bug should be investigated. 2010-02-26 18:25:56 -08: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
ab0cc7286f Setting UrlFor in with_routing is no longer needed now that it's not global 2010-02-26 15:56:38 -08:00
Carlhuda
47fe14bfcc Silence test deprecation warnings 2010-02-26 15:34:12 -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
José Valim
bd36418c51 Fix controller_path returnsing an empty string in Ruby 1.8.7 [#4036 status:resolved] 2010-02-26 11:51:21 +01:00
Carlhuda
f863045c45 Rename metaclass to singleton_class 2010-02-25 17:56:58 -08:00
Carlhuda
8760add31a Get URL helpers working again in integration tests. 2010-02-25 17:53:30 -08:00
Carlhuda
36fd9efb5e Continued effort to deglobalize the router 2010-02-25 17:53:01 -08:00
Carlhuda
a278f23310 Fix all of AP's tests with the non global router 2010-02-25 17:53:01 -08:00
Carlhuda
4b038f638d Merge branch 'master' of github.com:rails/rails 2010-02-25 17:53:01 -08:00
Carlhuda
226dfc2681 WIP: Remove the global router 2010-02-25 17:53:00 -08:00
José Valim
a39c7505bd Cleanup render callstack and make render(:json => {}, :status => 401) work again. 2010-02-24 22:17:25 +01:00
Carl Lerche
6a061187e2 Remove ActionController::Base.resources_path_names 2010-02-24 10:52:16 -08:00
Yehuda Katz
ae933a093d Fix render :file => "#{Rails.root}/public/404.html", :status => :not_found. Closes #8994 2010-02-23 22:45:42 -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
Carlhuda
5e2bd08023 Makes send_file work again by deferring to Rack::Sendfile.
* Add the Rack::Sendfile middleware
  * Make the header to use configurable via config.action_dispatch.x_sendfile_header (default to "X-Sendfile"). 
  * Add Railties tests to confirm that these work
  * Remove the :stream, :buffer_size, and :x_senfile default options to send_file
  * Change the log subscriber to always say "Sent file"
  * Add deprecation warnings for options that are now no-ops

Note that servers can configure this by setting X-Sendfile-Type. Hosting companies and those creating packages of servers specially designed for Rails applications are encouraged to specify this header so that this can work transparently.
2010-02-23 17:06:35 -08:00
Carlhuda
3345af61fb Fix streaming by having it create a File object, which can be handled by Rack servers as appropriate 2010-02-23 15:37:17 -08:00
Martin Schürrer
6bc24d40d5 Use ActionDispatch::Routing everywhere 2010-02-21 13:43:51 -08:00
José Valim
250c809246 Require persisted? in ActiveModel::Lint and remove new_record? and destroyed? methods. ActionPack does not care if the resource is new or if it was destroyed, it cares only if it's persisted somewhere or not. 2010-02-21 11:12:14 +01:00
snusnu
f81c6bc040 AMo #key is now #to_key and CI is probably happy
Obviously #key is a too common name to be included
in the AMo interface, #to_key fits better and also
relates nicely to #to_param. Thx wycats, koz and
josevalim for the suggestion.

AR's #to_key implementation now takes customized
primary keys into account and there's a testcase
for that too.

The #to_param AMo lint makes no assumptions on how
the method behaves in the presence of composite
primary keys. It leaves the decision wether to
provide a default, or to raise and thus signal to
the user that implementing this method will need
his special attention, up to the implementers. All
AMo cares about is that #to_param is implemented
and returns nil in case of a new_record?.

The default CompliantObject used in lint_test
provides a naive default implementation that just
joins all key attributes with '-'.

The #to_key default implementation in lint_test's
CompliantObject now returns [id] instead of [1].
This was previously causing the (wrong) tests I
added for AR's #to_key implementation to pass. The
#to_key tests added with this patch should be
better.

The CI failure was caused by my lack of knowledge
about the test:isolated task. The tests for the
record_identifier code in action_controller are
using fake non AR models and I forgot to stub the
#to_key method over there. This issue didn't come
up when running the test task, only test:isolated
revealed it. This patch fixes that.

All tests pass isolated or not, well, apart from
one previously unpended test in action_controller
that is unrelated to my patch.
2010-02-20 20:17:29 -08:00
Carlhuda
a3c6ad7d5e Fix a bunch of pending tests by providing an introspection mode for the Response object that does up-front parsing of the headers to populate things like @etag 2010-02-19 19:19:20 -08:00
Joshua Peek
7d7f9ccfdf Reinstate pending tests that were supposed to be fixed before the
beta.

Shout louder this time so they actually get fixed.
2010-02-19 09:34:22 -06:00
José Valim
3f948a0e29 Merge master. 2010-02-17 00:48:04 +01:00
José Valim
e8ef12e39d Make Railties tests green again. 2010-02-17 00:14:49 +01:00
José Valim
b1edd09662 Ensure render :text => resource first tries to invoke :to_text on it 2010-02-16 23:26:29 +01:00
Prem Sichanugrist
f0523f72b4 Rename Rails::Subscriber to Rails::LogSubscriber 2010-02-16 22:36:15 +01:00
Joshua Peek
eec2d301d4 Fix test load paths for those not using bundler 2010-02-15 10:20:11 -06:00
Yehuda Katz
5384df5589 Updates subscriber test for new output 2010-02-05 22:48:13 -08:00
Jeremy Kemper
31f8a59c16 Test that csrf meta content is html-escaped, too 2010-02-04 18:03:06 -08:00
Jeremy Kemper
6bf79f02be Revert dumb test 2010-02-04 17:49:23 -08:00
Jeremy Kemper
3062bc70ef HTML-escape csrf meta contents 2010-02-04 17:45:43 -08:00
Jeremy Kemper
2191aa47ac Expose CSRF param name also 2010-02-04 15:26:24 -08:00
Jeremy Kemper
78de17cf70 Expose CSRF tag for UJS adapters 2010-02-04 14:58:32 -08:00
Jeremy Kemper
e5ab4b0d07 Convert to class_attribute 2010-02-01 02:02:42 -08:00
Yehuda Katz
2092351652 Add support for compile-time <%= raw %> 2010-01-31 23:42:35 -08:00
Yehuda Katz
4cbb9db0a5 For performance reasons, you can no longer call html_safe! on Strings. Instead, all Strings are always not html_safe?. Instead, you can get a SafeBuffer from a String by calling #html_safe, which will SafeBuffer.new(self).
* Additionally, instead of doing concat("</form>".html_safe), you can do
    safe_concat("</form>"), which will skip both the flag set, and the flag
    check.
  * For the first pass, I converted virtually all #html_safe!s to #html_safe,
    and the tests pass. A further optimization would be to try to use
    #safe_concat as much as possible, reducing the performance impact if
    we know up front that a String is safe.
2010-01-31 19:39:13 -08:00
Mikel Lindsaar
2ebea1c02d deOMGifying Railties, Active Support, and Action Pack 2010-01-31 09:46:30 -08:00
José Valim
b3a028259f Improve missing template error messages a little bit. 2010-01-31 10:24:38 +01:00
Joshua Peek
9c2c307ee4 Move form_remote_tag and remote_form_for into prototype_legacy_helper 2010-01-30 15:42:30 -06:00