Commit Graph

118 Commits

Author SHA1 Message Date
Charlie Somerville
2e21cced12 more test fixing 2013-10-24 12:54:06 -04:00
Charlie Somerville
ca7a53cbe9 fix tests 2013-10-24 12:46:30 -04:00
Charlie Somerville
06d4ca0254 establish a baseline by skipping all tests failing before 2.0.0 2013-08-06 17:41:45 -07:00
Andrew White
0e52a609fd Don't create a deprecation proxy object if the variable was passed in local_assigns [#1671 state:resolved] 2010-10-26 12:57:21 +01:00
Jeff Kreeftmeijer
2de364636c partial counters with :as [#2804 state:resolved]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-05-15 10:32:45 -07:00
Jeremy Kemper
2cd29f4297 Only set response etag if body is not blank 2010-04-09 20:19:03 -07:00
Jeremy Kemper
d91d6fe15f CI: show all headers for diagnosis 2010-04-09 20:06:35 -07:00
Jeremy Kemper
56c5290fce CI: message for some outstanding failures 2010-04-09 19:32:47 -07:00
rick
d052e9fb58 Add pluggable JSON backends with support for the JSON gem.
Example: ActiveSupport::JSON.backend = "JSONGem"

All internal Rails JSON encoding is now handled by
ActiveSupport::JSON.encode().  Use of #to_json is not recommended, as it
may clash with other libraries that overwrite it.  However, you can
recover Rails specific functionality
if you really want to use #to_json.

    gem 'json'
    ActiveSupport::JSON.backend = "JSONGem"

    class ActiveRecord::Base
      alias to_json rails_to_json
    end
2009-05-17 18:40:38 -07:00
Jeremy Kemper
7c4b325e0a Fix render :json => nil [#2589 state:resolved] 2009-04-30 16:47:42 -07:00
misfo
7706b57034 allowed render :file to take Pathnames [#2220 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-03-14 10:42:02 -05:00
Jeremy Kemper
1c36172c13 Ruby 1.9 compat: rename deprecated assert_raises to assert_raise.
[#1617 state:resolved]
2009-03-08 13:11:58 -07:00
Joshua Peek
ea8488caef Fixed simplified render with nested models [#2042 state:resolved] 2009-03-07 14:05:18 -06:00
Matt Jones
87e8b16246 fix HTML fallback for explicit templates [#2052 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-03-07 13:32:46 -06:00
Johan Sørensen
c071123b3e Ensure expires_in without a :public key sets the Cache-Control header to private. [#2095 state:resolved]
This fixes a regression introduced in f2a32bd0, which wasn't exposed due to two
test methods having the same name.

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-03-07 12:18:10 +00:00
Gregg Pollack
f2a32bd0de Added ability to pass in :public => true to fresh_when, stale?, and expires_in to make the request proxy cachable [#2095 state:committed]
Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
2009-02-28 10:33:42 +01:00
Matt Jones
b35562f432 correctly handle layouts for AJAX requests and regular js files [#2052 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-02-24 10:38:07 -06:00
Adam McCrea
06182ea02e implicitly rendering a js response should not use the default layout [#1844 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-02-05 15:23:05 -06:00
Joshua Peek
093f758bd0 Restore implicit rendering for XHR requests that want a HTML template [#1590 state:resolved] 2009-01-27 14:09:11 -06:00
Jeremy Kemper
074414883c Remove Content-Length header from :no_content responses 2009-01-07 15:55:28 -08:00
Pratik Naik
80307c8b0a Make ActionController#render(symbol) behave same as ActionController#render(string) [#1435] 2008-12-26 01:12:11 +00:00
Pratik Naik
cd1d6e8768 Make ActionController#render(string) work as a shortcut for render :action => string. [#1435]
Examples:
  # Instead of render(:action => 'other_action')
  render('other_action')

Note : Argument must not have any '/'
2008-12-25 23:05:34 +00:00
Pratik Naik
d67e03871e Make ActionController#render(string) work as a shortcut for render :template => string. [#1435]
Examples:
  # Instead of render(:template => 'controller/action')
  render('controller/action')

Note : Argument must not begin with a '/', but have at least one '/'
2008-12-25 22:26:03 +00:00
Pratik Naik
061952392a Make ActionController#render(string) work as a shortcut for render :file => string. [#1435]
Examples:
  # Instead of render(:file => '/Users/lifo/home.html.erb')
  render('/Users/lifo/home.html.erb')

Note : Filename must begin with a forward slash ('/')
2008-12-25 21:43:07 +00:00
Pratik Naik
04a8b2362d Make render_test.rb run in isolation 2008-12-25 19:28:08 +00:00
Joshua Peek
fda62ecf70 Rename AbstractResponse to Response and inheirt from Rack::Response 2008-12-19 17:15:22 -06:00
Joshua Peek
3da1b94d07 Use status response accessor instead of the 'Status' header 2008-12-19 15:05:51 -06:00
Hongli Lai (Phusion
9e2b4a10f7 Do not output an ETag header if response body is blank or when sending files with send_file(... :xsendfile => true) [#1578 state:committed]
Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
2008-12-16 12:30:28 +01:00
mark
49306ccacf Add :partial option to assert_template [#1550 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2008-12-11 11:06:35 -06:00
Joshua Peek
148aff2097 Set template_format to html inside rjs templates so renders within it default to html. 2008-12-04 17:20:51 -06:00
Sam Stephenson
ab211bf592 Fix rendering html partials from an rjs template
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2008-12-04 16:35:13 -06:00
Michael Koziarski
9fdb15e60f Change the forgery token implementation to just be a simple random string.
This deprecates the use of :secret and :digest which were only needed when we were hashing session ids.
2008-11-23 14:28:34 +01:00
Luke Melia
60d6f25517 Fix rendering html partial via inline render when with :js format [#1399 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2008-11-18 15:19:16 -06:00
Luke Melia
75fb8dfb99 Prevent assert_template failures when a render :inline is called before rendering a file-based template [#1383 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2008-11-17 22:09:22 -06:00
Jeremy Kemper
c82e8e1f48 Move controller assertions from base TestCase to AC:: and AV::TestCase 2008-11-07 15:42:34 -05:00
David Heinemeier Hansson
cbeac93310 Added render :js for people who want to render inline JavaScript replies without using RJS [DHH] 2008-11-01 12:03:49 +01:00
Joshua Peek
2092687bcb Ensure content type gets reset after render_to_string [#1182 state:resolved] 2008-10-30 15:26:29 -05:00
David Heinemeier Hansson
18542c9e00 Dont try to auto-set the etag based on the body if any freshness headers have already been set [DHH/José Valim] 2008-10-21 16:58:12 +02:00
David Heinemeier Hansson
448e7e7c04 Let fresh_when actually do the head(:not_modified). Cleaner and we get the filter halting for free then. 2008-10-21 02:54:55 +02:00
David Heinemeier Hansson
9acb88e666 Added stale?/fresh? and fresh_when methods to provide a layer of abstraction above request.fresh? and friends [DHH] 2008-10-21 02:30:13 +02:00
Michael Koziarski
aec391621b Make sure last_modified! works with <= rather than just equality. 2008-10-07 21:09:07 +02:00
Michael Koziarski
0eefa7058a Fix etag! and last_modified! to work as advertised.
Add tests too.
2008-09-30 17:00:38 +02:00
Jonathan del Strother
6cfb70023a Don't set Content-Length on 304 responses
Commit 8aad8c claimed to do this, but it checks for the 304 status too early, before handle_conditional_get! has overridden it.

[#958 state:resolved]

Signed-off-by: Jonathan del Strother <jon.delStrother@bestbefore.tv>
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2008-09-02 22:57:40 +02:00
Pratik Naik
56c2b02f59 Fix AM tests and add tests for rendering logging 2008-08-31 16:29:21 +01:00
Pratik Naik
4fb75392aa Add test to make sure RJS block inside controller is executed in view context 2008-08-30 21:47:35 +01:00
Joshua Peek
a200c67611 Merge RenderTest and NewRenderTest 2008-08-29 13:26:28 -05:00
Ryan Bates
a8ece12fe2 Return nil instead of a space when passing an empty collection or nil to 'render :partial' [#791 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2008-08-19 19:09:04 -05:00
Jeremy Kemper
ba2d61dd81 Update tests for request memoization 2008-08-08 02:31:12 -07:00
Jeremy Kemper
b7529ed1cc Simplifying usage of ETags and Last-Modified and conditional GET requests 2008-08-07 23:43:12 -07:00
Tom Ward
c3d1fda555 Set the response content type to that of found template if not explicitly set elsewhere [#444 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2008-07-18 20:14:12 -05:00