Commit Graph

1218 Commits

Author SHA1 Message Date
Nicholas Seckar
065b3af358 Explain thyself
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3893 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-16 04:09:18 +00:00
David Heinemeier Hansson
f7359342af Added protection against proxy setups treating requests as local even when they're not #3898 [stephen_purcell@yahoo.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3892 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-16 03:31:40 +00:00
David Heinemeier Hansson
275ea6de49 Added TestRequest#raw_post that simulate raw_post from CgiRequest (closes #3042) [francois.beausoleil@gmail.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3888 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-16 03:15:12 +00:00
David Heinemeier Hansson
7d06259be9 Dots in template path should not trip up rendering (closes #4244) [lmarlow@yahoo.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3884 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-16 02:51:19 +00:00
David Heinemeier Hansson
500c734935 Breakpoints in running code makes for no fun ;)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3883 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-16 02:48:25 +00:00
Tobias Lütke
7bbc759dc0 Fixes a bug in routes controller traversing which caused it to fail on for double nested controllers. [Tobias Luetke]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3879 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-15 22:48:22 +00:00
Jamis Buck
2429074075 Underscore dasherized keys in formatted requests
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3878 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-15 21:46:41 +00:00
Jamis Buck
6480d49749 Add MimeResponds::Responder#any for managing multiple types with identical responses
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3876 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-15 18:27:26 +00:00
Jamis Buck
4ba5aa257b use "mime_type" instead of "format"
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3874 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-15 18:04:24 +00:00
Jamis Buck
6784749f3b Fix Mime::Type#to_sym to do @string.to_sym. Add text/yaml as alias for Mime::YAML
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3873 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-15 15:12:24 +00:00
Jamis Buck
953d7c9aa4 Make the xml_http_request testing method set the HTTP_ACCEPT header
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3867 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-14 19:53:27 +00:00
Michael Koziarski
c6abe81b1e Add verification to scaffolds (generated and reflection based). Require POST for unsafe actions [Michael Koziarski]. Closes #2601
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3864 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-14 01:57:12 +00:00
Nicholas Seckar
8ff4463193 Simplify controller_path
Cache File.directory? calls to avoid filesystem calls when using layouts


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3861 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-13 15:54:33 +00:00
David Heinemeier Hansson
97dd9a91c2 Always use application/xml, then the charset is determined by the XML doc
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3860 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-13 05:51:55 +00:00
David Heinemeier Hansson
928627292c The mere existance of a rjs file shouldnt cause the layout to disappear. Made it easier to specify a :with on observer_field
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3859 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-13 03:29:39 +00:00
David Heinemeier Hansson
75b8a66638 The mere existance of a rjs file shouldnt cause the layout to disappear. Made it easier to specify a :with on observer_field
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3858 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-13 03:27:26 +00:00
Sam Stephenson
3589871de8 Added simple alert() notifications for RJS exceptions when config.action_view.debug_rjs = true. Set debug_rjs = true for the default development environment.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3856 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-13 02:11:59 +00:00
David Heinemeier Hansson
955583aed4 Prefer application/xml over text/xml for charset reasons
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3855 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-13 02:05:59 +00:00
David Heinemeier Hansson
06c2b43f36 Rendering xml shouldnt happen inside any layout. Added class proxying to RJS, so you can call page.field.clear("my_field") to generate Field.clear("my_field");. Added :content_type option to render, so you can change the content type on the fly. Do type/subtype reordering of Accept header preferences for xml types (aka make Firefox work with respond_to). CHANGED DEFAULT: The default content type for .rxml is now application/xml instead of type/xml, see http://www.xml.com/pub/a/2004/07/21/dive.html for reason
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3852 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-13 01:33:57 +00:00
David Heinemeier Hansson
60e40647d7 Prepare for mime type reordering depending on the branch [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3850 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-12 19:01:09 +00:00
David Heinemeier Hansson
09cec78248 Default mime type for XML should be application/xml [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3849 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-12 18:50:14 +00:00
David Heinemeier Hansson
de37f7df4f Mime types are separated by a comma, not semicolon, in the Accept header. Also switch all internal configuration of mime types away from strings and over to Mime::Type [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3847 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-12 16:03:44 +00:00
David Heinemeier Hansson
7af12d04ce Added synonym and custom type handling to respond_to [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3844 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-12 06:02:44 +00:00
David Heinemeier Hansson
9e2932f816 Assume that we accept what we give [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3843 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-12 05:13:55 +00:00
David Heinemeier Hansson
de660957a5 Added defaults to respond_to [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3842 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-12 03:39:58 +00:00
David Heinemeier Hansson
6e3e5cadfb Added option to render action/template/file of a specific extension (and here by template type). This means you can have multiple templates with the same name but a different extension [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3841 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-12 01:56:55 +00:00
Jamis Buck
8e8b6b9e40 More integration testing tweaks
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3840 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-12 00:08:26 +00:00
Nicholas Seckar
77e2f00c28 Don'tt abort rake when rendering the _trace.rhtml template
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3839 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-11 02:53:39 +00:00
David Heinemeier Hansson
1c16649b48 Added better support for using the same actions to output for different sources depending on the Accept header [DHH] Added Base#render(:xml => xml) that works just like Base#render(:text => text), but sets the content-type to text/xml and the charset to UTF-8 [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3838 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-11 01:23:29 +00:00
Jamis Buck
8152695b80 Make assertions in integration sessions proxy to the test instance (only for sessions created via open_session)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3836 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-10 18:00:53 +00:00
Jamis Buck
bfbbd4c346 make sure nil @session doesn't mess up wsod stacktraces
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3834 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-10 14:41:37 +00:00
Thomas Fuchs
130001c377 Update to latest script.aculo.us trunk, fixes possible issue with Effect.Appear on IE
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3824 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-09 09:59:29 +00:00
Jamis Buck
5568d20b2e Move methods from TestResponse into a module, so they can be shared with response objects in integration tests. (This allows standard functional test assertions to be used in integration tests, like assert_response and assert_template.)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3820 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-09 04:57:08 +00:00
Tobias Lütke
aafc191ab7 Integration test's url_for now runs in the context of the last request (if any) so after post /products/show/1 url_for :action => 'new' will yield /product/new
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3819 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-08 20:12:30 +00:00
Jamis Buck
519e7e5e12 Fix problem with unloaded ARStore sessions being loaded when they are garbage collected, causing problems if there were AR objects in the session.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3817 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-08 16:53:34 +00:00
Rick Olson
043bee3338 Re-added mixed-in helper methods for the JavascriptGenerator. Moved JavascriptGenerators methods to a module that is mixed in after the helpers are added. Also fixed that variables set in the enumeration methods like #collect are set correctly. Documentation added for the enumeration methods [Rick Olson].
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3814 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-08 05:21:27 +00:00
Rick Olson
3c78d0b1eb remove explicit Builder require
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3813 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-08 03:28:25 +00:00
David Heinemeier Hansson
cd989472a5 Added Hash#to_xml and Array#to_xml that makes it much easier to produce XML from basic structures [DHH] Moved Jim Weirich's wonderful Builder from Action Pack to Active Support (it's simply too useful to be stuck in AP) [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3812 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-08 02:56:25 +00:00
Jamis Buck
24fca9d92e make integration testing not interfere with command-line regex test filters
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3811 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-07 22:04:23 +00:00
Jamis Buck
4d4f0e6490 Make IntegrationTest refer to superclass properties using copy-on-write
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3810 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-07 17:58:34 +00:00
David Heinemeier Hansson
6fd737b76b Proper options for XmlSimple
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3808 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-07 04:52:49 +00:00
Jamis Buck
0fbe6837b1 more integration tweaks
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3807 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-07 04:42:24 +00:00
David Heinemeier Hansson
dc4b5cff39 XmlSimple _should_ be the default since XmlNode is not compatible with regular parameters -- also known as Why Did My Etech Demo Not Work? [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3806 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-07 04:42:13 +00:00
Jamis Buck
1c0163e50c A few minor tweaks to the integration testing stuff
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3805 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-07 01:07:54 +00:00
David Heinemeier Hansson
08967ead78 Allow method chaining in RJS elements [Rick Olson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3801 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-06 19:45:02 +00:00
Sam Stephenson
382741f289 Update Prototype for beta gems
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3795 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-06 17:33:25 +00:00
David Heinemeier Hansson
c450a36f16 Doc fixes
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3782 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-05 21:37:12 +00:00
Tobias Lütke
0635f633cc ActionController::Base.param_parsers now accept symbols. currently supported are :xml_node, :xml_simple and :yaml
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3778 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-05 19:16:55 +00:00
Tobias Lütke
03d37a2d68 Added new infrastructure support for REST webservices.
By default application/xml posts are handled by creating a XmlNode object with the same name as the root element of the submitted xml. M$

 ActionController::Base.param_parsers['application/atom+xml'] = Proc.new do |data|
    node = REXML::Document.new(post)
   { node.root.name => node.root }
 end

 XmlSimple and Yaml web services were retired, ActionController::Base.param_parsers carries an example which shows how to get this functio$
 request.[formatted_post?, xml_post?, yaml_post? and post_format] were all deprecated in favor of request.content_type [Tobias Luetke]

Closes #4081


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3777 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-05 18:59:58 +00:00
David Heinemeier Hansson
2d491bddf7 Fixed tests (closes #4087) [Rick Olson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3774 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-05 16:41:04 +00:00