Commit Graph

2388 Commits

Author SHA1 Message Date
Yehuda Katz
b71f83c9cc Work around apparent bug in 1.9 2009-10-15 16:03:30 -07:00
José Valim
2d7abe245e Renamed Orchestra to Notifications once again [#3321 state:resolved] 2009-10-15 18:51:51 -03:00
José Valim
a15e02d44a Unify benchmark APIs. 2009-10-15 18:19:25 -03:00
José Valim
8f59d7a8d8 Instrument cache store events only if required. 2009-10-15 18:19:24 -03:00
José Valim
af0d1fa892 Update Orchestra instrumentations and move part of logging to Orchestra. 2009-10-15 18:18:44 -03:00
José Valim
8b340ab2f6 Revert "Rename Orchestra to Notifications [#3321 state:resolved]"
This reverts commit 8cbf825425dc8ad3770881ea4e100b9023c69ce2.
2009-10-15 18:06:15 -03:00
Jeremy Kemper
4484f0bccf Don't push siblings on load path if using bundled env 2009-10-14 20:59:45 -07:00
Jeremy Kemper
c09a5ffea7 Merge branch 'arel' 2009-10-14 19:32:09 -07:00
Jeremy Kemper
6eee1dd62c Clarify AR dependency 2009-10-14 19:31:29 -07:00
Joshua Peek
8cbf825425 Rename Orchestra to Notifications [#3321 state:resolved] 2009-10-14 19:50:36 -05:00
George Ogata
3de8b44b26 Make IntegrationTest::Runner propagate method_missing to ancestors.
Fixes RSpec integration example groups, which mixes its Matchers
module into ActiveSupport::TestCase.

Signed-off-by: Michael Koziarski <michael@koziarski.com>
2009-10-15 11:01:42 +13:00
Craig Smith
316f4704ea Test cases should see all the cookies, not just cookies that have been set in the controller.
Previously this example would always pass, even when cookies.delete was not called.

@request.cookies['foo'] = 'bar'
get :delete_cookie
assert_nil cookies['foo']

Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#2768 state:committed]
2009-10-15 10:58:55 +13:00
Michael Koziarski
1d01bad3ce Make sure non-escaped urls aren't considered safe 2009-10-15 09:58:35 +13:00
Phil Darnowsky
1b3195b63c ActionView.url_for doesn't escape by default
ActionView::Helpers::UrlHelper#url_for used to escape the URLs it generated by
default.  This was most commonly seen when generating a path with multiple
query parameters, e.g.

  url_for(:controller => :foo, :action => :bar, :this => 123, :that => 456)

would return

  http://example.com/foo/bar?that=456&amp;this=123

escaping an ampersand that shouldn't be escaped.  This is both wrong and
inconsistent with the behavior of ActionController#url_for, and is changed.

Signed-off-by: Michael Koziarski <michael@koziarski.com>
2009-10-15 09:49:07 +13:00
Yehuda Katz
a41c6c35ca Start adding configuration to ActionView instead of using constants.
By using config rather than hardcoded constants, we can evolve the
  configuration system over time (we'd just need to update the config
  method with more robust capabilities and all consumers would get
  the capabilities with no code changes)
2009-10-14 13:36:41 -07:00
Jeffrey Hardy
a8dc9fd27b CookieJar#delete should return the key's value, consistent with a Hash
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-10-14 11:50:51 -07:00
Joshua Peek
8b46c50eac Kill mock routing assertion that tests router implementation 2009-10-10 21:30:51 -05:00
Joshua Peek
e61bc8e29f Fix failing safe buffer test. We don't patch CGI.escapeHTML, only ERB:Util. 2009-10-10 21:30:51 -05:00
Joshua Peek
1610cd0827 Move safe buffer into test/template 2009-10-10 21:30:51 -05:00
Joshua Peek
21be1dcffa Relative url generations are covered more thoroughly by url rewriter tests 2009-10-10 21:30:50 -05:00
Joshua Peek
673f73b538 Add define another "stuff" controller to support routing tests 2009-10-10 21:30:50 -05:00
Joshua Peek
5d071b4bc2 Drop implementation specific routing test assertions 2009-10-10 21:30:50 -05:00
Joshua Peek
7bc5e3bd02 Add define a "stuff" controller in fixtures to support routing tests 2009-10-10 21:30:50 -05:00
Joshua Peek
3b6bdfc105 API change: content_tag_for outputs prefixed class name 2009-10-08 14:13:49 -05:00
Michael Koziarski
9415935902 Switch to on-by-default XSS escaping for rails.
This consists of:

  * String#html_safe! a method to mark a string as 'safe'
  * ActionView::SafeBuffer a string subclass which escapes anything unsafe which is concatenated to it
  * Calls to String#html_safe! throughout the rails helpers
  * a 'raw' helper which lets you concatenate trusted HTML from non-safety-aware sources (e.g. presantized strings in the DB)
  * New ERB implementation based on erubis which uses a SafeBuffer instead of a String

Hat tip to Django for the inspiration.
2009-10-08 09:31:20 +13:00
Joshua Peek
b480da5cd6 Coerce all out going body parts to Strings 2009-10-05 13:58:43 -05:00
Joshua Peek
86d0590022 Only draw default route once 2009-10-03 23:55:35 -05:00
Joshua Peek
86ed58d912 Use with_routing helper in tests instead of modifying global route set 2009-10-03 23:31:38 -05:00
Joshua Peek
61411f2aeb Redraw default routes on all internal integration tests. We don't need SimpleRouteCase anymore 2009-10-03 23:18:32 -05:00
Joshua Peek
8287a112c9 Avoid creating new controller constants during test runtime. All routable controllers should be defined beforehand. 2009-10-03 23:03:08 -05:00
Joshua Peek
f5cba5e6b1 Moved shared form helper models into fake_models 2009-10-03 22:14:50 -05:00
Joshua Peek
7eaed071a2 Changing directories during the test breaks file loading when ran by itself 2009-10-03 22:02:51 -05:00
Joshua Peek
660eb068d3 Don't load rubygems for isolated tests 2009-10-03 21:51:34 -05:00
Joshua Peek
75a2f00c97 Move improved isolated test runner to AP 2009-10-03 21:33:06 -05:00
Joshua Peek
018b79dd36 File extra test folders into controller, dispatch, or template 2009-10-03 21:05:51 -05: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
Erik Ostrom
8ffc2e3b8d Ported the new ActionView::TestCase from 2-3-stable to master [#3260
state:resolved]

The test case now mimicks the template environment more closely, so it's
possible to use render, load helper dependencies.

This also fixes assert_select, and similar assertions. Because view tests
and helpers generally don't render full templates assert_select looks
first in rendered and then in output_buffer to find the rendered output.

Additional `master'-only changes: Made the Action Pack Rakefile run the
ActionView::TestCase tests, and made ActionView::Rendering#_render_text
always return a string.

Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-09-28 13:31:30 -05:00
John Trupiano
c9318e9010 Introduce :almost keyword for distance_of_time_in_words. Make 1.75 days - 2 days return '2 days'.
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#3266 state:committed]
2009-09-28 14:37:31 +13:00
Jay Pignata
8ef1cd9733 Enhancing distance_of_time_in_words to prefix year output with over and about depending upon how many months have elapsed
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#3106 state:committed]
2009-09-28 14:36:38 +13:00
Joshua Peek
a6757a02e1 Move middleware and route configuration from AC::Dispatcher to Rails application object 2009-09-26 21:59:28 -05:00
Joshua Peek
14866fa3d8 Allow setting a default application for all integration tests 2009-09-26 21:38:48 -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
02413baabb Fix skipping memcache tests if a memcache server isn't running 2009-09-26 20:02:47 -05:00
Joshua Peek
198081a639 Remove deprecated calls to Dispatcher.to_prepare 2009-09-26 19:57:36 -05:00
Joshua Peek
1f72700575 Move default middleware stack into initializer 2009-09-26 13:41:32 -05:00
Joshua Peek
71b33ec482 AC::Dispatcher is the default app, don't need to set it 2009-09-26 13:02:34 -05:00
Joshua Peek
0c638b3406 Clean up session integration tests so they don't reference AC::Dispatcher 2009-09-26 12:56:53 -05:00
Joshua Peek
ef58194129 Move Rails::Static into ActionDispatch 2009-09-26 11:37:42 -05:00
Joshua Peek
088ce2904d Fix generic url rewriter in integration tests 2009-09-25 11:10:39 -05:00
Jeremy Kemper
0bd6e933c0 Restore split between require-time and runtime load path mungery. Simplifies vendor requires. 2009-09-24 18:38:18 -07:00
Joshua Peek
9f96708f53 Resurrect AC::Benchmarking [#3140 state:resolved] 2009-09-24 12:13:09 -05:00
Joshua Peek
542ddde5d4 Move helpers specific to functional tests out of TestProcess into AC::TestCase 2009-09-23 23:03:24 -05:00
Joshua Peek
4a55d1de8d Move integration test runner into ActionDispatch 2009-09-23 22:38:19 -05:00
José Valim
2407479603 Fixes Sam Ruby tests suite.
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-09-21 17:56:24 -07:00
José Valim
a0233dd3b2 Use NewCallbacks on ActionDispatch::Callbacks. 2009-09-20 10:56:38 -03:00
José Valim
7cc1c2e71d Add Orchestra instrumentation to fragment and page caching. 2009-09-20 10:56:38 -03:00
Joshua Peek
f5ace625fe Ensure changes to I18n locale get reset during tests 2009-09-19 13:22:09 -05:00
Joshua Peek
f1c8f07be8 Follow short name convention for test folder and just call it "abstract" 2009-09-19 13:14:22 -05:00
Joshua Peek
69192bee2d Merge bundler helper into abstract_unit 2009-09-19 13:12:54 -05:00
Joshua Peek
0540781539 Namespace TestControllers inside their test case class 2009-09-19 13:04:12 -05:00
Joshua Peek
db0af8075d Avoid conflict with a "MetalTest" module used in tests 2009-09-19 12:52:52 -05:00
Joshua Peek
355e2350ca All on one base, don't need this 2009-09-19 12:51:28 -05:00
Joshua Peek
12b3799448 Avoid conflicts with another ContentTypeController used in testing 2009-09-19 12:50:14 -05:00
Joshua Peek
f05b1e5eb1 All on one abstract_unit 2009-09-19 12:10:41 -05:00
Joshua Peek
a6f19a155a There is only one base now 2009-09-19 11:57:56 -05:00
Joshua Peek
5bc47a93b7 Make sure caching test is using a generatable url 2009-09-19 11:56:11 -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
Jeremy Kemper
ec36edff2d Use abort 2009-09-13 21:52:18 -07:00
Joshua Peek
988a614dd2 Don't run gem bundle by default 2009-09-13 23:33:54 -05:00
Joshua Peek
b2f0b8cbda Rollback AS bundler work and improve activation of vendored dependencies 2009-09-13 22:55:46 -05:00
Joshua Peek
a0e43073e2 Rewrite resource routing tests that are coupled to the router implementation 2009-09-13 18:43:16 -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
213c920e4f Define weblog controller for url helper test 2009-09-13 17:28:44 -05:00
Joshua Peek
076d7f885e AP tests: detect missing dependencies and automatically run bundler 2009-09-13 16:37:30 -05:00
Joshua Peek
6d214c953b Merge abstract_controller/test_helper and new_base/test_helper since they are expected to run in the same testing sandbox 2009-09-13 16:30:27 -05:00
Joshua Peek
48c81f52d4 Remove dead old base abstract unit 2009-09-13 15:34:17 -05:00
Joshua Peek
25f4129151 Need to declare optional dependencies from AS 2009-09-13 12:58:49 -05:00
Joshua Peek
a9f5f4bb45 Don't force test suite to use bundler 2009-09-13 12:42:13 -05:00
Michael Koziarski
81cba78e9e Merge commit 'alloy/master-nested_attributes_and_autosave' 2009-09-13 10:32:24 +12:00
Yehuda Katz
ddb4600ce6 Get ActionPack's test running on bundled gems. This should make running tests on new machines, as well as CI, work well. 2009-09-12 15:22:11 -05:00
Yehuda Katz
7152a4e9a6 Add per-controller middleware 2009-09-12 13:51:15 -05:00
Andrew France
1b78e9bba3 Allow fields_for on a nested_attributes association to accept an explicit collection to be used. [#2648 state:resolved]
Signed-off-by: Eloy Duran <eloy.de.enige@gmail.com>
2009-09-12 15:50:05 +02:00
Nathaniel Talbott
f024aabee3 Fix filtering parameters when there are Fixnum or other un-dupable values.
[#3184 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-09-10 18:53:50 -07:00
Joshua Peek
1a0f822037 Use draw/connect mapper api instead of directly using add_named_route 2009-09-06 23:21:04 -05:00
Joshua Peek
314e18aba2 Need to reset session for AR session tests after altering the route set 2009-09-06 23:09:47 -05:00
Joshua Peek
2ae84e04aa Add fake controllers for url rewriter tests 2009-09-06 23:02:55 -05:00
Joshua Peek
c531bd6665 Cleanup hacky routing with controller_path in url helper tests. This doesn't work in real life anyway. 2009-09-06 22:29:29 -05:00
Joshua Peek
ab8aac09d6 Need to reset session in internal integration tests after altering the route set 2009-09-06 22:01:58 -05:00
Joshua Peek
9f47f8d892 Fix isolated running of AddressesTest 2009-09-06 21:42:05 -05:00
Joshua Peek
1c02fc295d Fix isolated running of ActionPackAssertionTest 2009-09-06 21:19:29 -05:00
Joshua Peek
c3accd7ded Fix failing isolated routing test 2009-09-05 19:39:33 -05:00
Yehuda Katz + Carl Lerche
487ee41d2f Test for previous commit (we wrote it first, I swear) 2009-09-03 12:58:43 -07:00
Yehuda Katz + Carl Lerche
e3744166ec Refactor ActionController to use find_template and template_exists? 2009-09-03 12:52:53 -07:00
Sam Pohlenz
4b6321efa9 Don't raise exceptions for missing javascript_include_tag or stylesheet_link_tag sources unless the :cache or :concat options are given. [#2738 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-09-03 14:01:01 -05:00
Yehuda Katz + Carl Lerche
f61dc0ef65 Remove a useless method in the fixture template class 2009-09-03 11:40:03 -07:00
Yehuda Katz + Carl Lerche
f3fc5c4b5f Refactor ActionView::Resolver 2009-09-03 11:18:57 -07:00
Jay Pignata
e0f1a7dc19 If session_options[:id] is requested when using CookieStore, unmarshal the session to access it [#2268 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-09-03 11:50:01 -05:00
Yehuda Katz + Carl Lerche
66a4585f88 Fix the */* with Net::HTTP bug [#3100 state:resolved] 2009-09-01 15:54:29 -07:00
Joshua Peek
c5f6e038da ActionPack test helpers need to activate rack gem 2009-09-01 10:27:19 -05:00
Bryan Helmkamp
a5588ffc08 Activate rack-test gem before it's required. This shouldn't be necessary, but should fix the build for now 2009-08-31 23:17:43 -07:00
Joshua Peek
a79790e1a5 rack-test 0.4.2 has rack 1.1.pre goodies, we'll use it instead 2009-08-31 23:08:20 -05:00
José Valim
3f78de67b5 Ensure that blocks are also handled inside the responder. 2009-08-29 18:21:19 +02:00
Joshua Peek
ba5995dcd9 Reset session in integration tests after changing routes to reload the middleware stack 2009-08-27 12:43:26 -05:00
Jeffrey Hardy
05b529ca57 UrlRewriter#rewrite_url should call #to_param on the value given in :anchor option, just as #url_for does
[#2746 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-26 14:11:26 -07:00
Akira Matsuda
cc9af20da7 I18n: use I18n for select helpers' prompt text
[#2252 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-26 13:55:57 -07:00
Jeremy Kemper
a7ca5595a2 Revert "I18n: use I18n for select helpers' prompt text"
Broke CI.

[#2252 state:open]

This reverts commit adedf72821a5623227ce91e6b298838e692477e4.
2009-08-26 12:12:40 -07:00
Akira Matsuda
adedf72821 I18n: use I18n for select helpers' prompt text
[#2252 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-26 11:29:16 -07:00
Yehuda Katz
9408fcd2e8 Create new ActionController::Middleware class that will work as a normal Rack middleware.
* This initial implementation is a bit hackish, but it uses a normal middleware API
    so it's future-proof when we improve the internals.
2009-08-26 00:18:52 -07:00
Joshua Peek
78129b1731 Track all AC base subclasses as possible controllers for internal testing 2009-08-25 23:34:48 -05:00
Yehuda Katz + Carl Lerche
c7ba911a43 ActionController::Metal can be a middleware 2009-08-25 12:14:31 -07:00
Joshua Peek
b58acea569 Move legacy param_parsers config onto AD::ParamsParser 2009-08-21 16:49:33 -05:00
Joshua Peek
ff1b0d3c86 k, thats really slow, lets not 2009-08-16 21:21:39 -05:00
Joshua Peek
24ad9ae3d2 Cleanup route reloading in tests. Prefer with_routing over using ActionController::Routing::Routes directly 2009-08-16 21:14:26 -05:00
Yehuda Katz
d6d550f0cb Missing fixture template -- fixes AP tests 2009-08-15 20:33:34 -07:00
Jay Pignata
679128da58 Adding a call to logger from params_parser to give detailed debug information when invalid xml or json is posted
[#2481 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-15 16:51:03 -07:00
Joshua Peek
911acc10de Axe "best fit" generation support 2009-08-15 18:08:46 -05:00
Yehuda Katz
1310231c15 Got tests to pass with some more changes.
* request.formats is much simpler now
    * For XHRs or Accept headers with a single item, we use the Accept header
    * For other requests, we use params[:format] or fallback to HTML
    * This is primarily to work around the fact that browsers provide completely
      broken Accept headers, so we have to whitelist the few cases we can
      specifically isolate and treat other requests as coming from the browser
    * For APIs, we can support single-item Accept headers, which disambiguates
      from the browsers
  * Requests to an action that only has an XML template from the browser will
    no longer find the template. This worked previously because most browsers
    provide a catch-all */*, but this was mostly accidental behavior. If you
    want to serve XML, either use the :xml format in links, or explicitly
    specify the XML template: render "template.xml".
2009-08-15 12:32:02 -07:00
Yehuda Katz
9f5cd0156a More cleanup of ActionView and reduction in need for blocks in some cases:
* only one of partial_name or :as will be available as a local
  * `object` is removed
  * Simplify _layout_for in most cases.
    * Remove <% render :partial do |args| %>
    * <% render :partial do %> still works fine
2009-08-15 12:32:01 -07:00
Yehuda Katz
27adcd1c1a Clean up ActionView some:
* Call _evaluate_assigns_and_ivars at the two entry points so we don't have to
    do a check at every render.
  * Make template.render viable without having to go through a wrapper method
  * Remove old TemplateHandler#render(template, local_assigns) path so we don't have
    to set self.template every time we render a template.
  * Move Template rescuing code to Template#render so it gets caught every time.
  * Pull in some tests from Pratik that test render @object in ActionView
2009-08-15 12:32:01 -07:00
Joshua Peek
940a391c9b Attempt to rewrite most of the highly coupled router segments tests 2009-08-14 16:16:29 -05:00
Joshua Peek
f86a4b84dd Kill routing timed tests 2009-08-14 14:30:19 -05:00
Joshua Peek
7a26c21d8e Use safe tmp dir 2009-08-13 21:03:25 -05:00
José Valim
8692b11e81 Merge branch 'master' of git://github.com/rails/rails 2009-08-13 10:27:53 +02:00
José Valim
4f9047ecc8 Ensure collections are not treated as nested resources. 2009-08-13 10:27:41 +02:00
Yehuda Katz
4bf516e072 More perf work:
* Move #set_cookie and #delete_cookie inline to optimize. These optimizations should
    almost certainly be sent back upstream to Rack. The optimization involves using
    an ivar for cookies instead of indexing into the headers each time.
  * Was able to use a bare Hash for headers now that cookies have their own joining
    semantics (some code assumed that the raw cookies were an Array).
  * Cache blankness of body on body=
  * Improve expand_cache_key for Arrays of a single element (common in our case)
  * Use a simple layout condition check unless conditions are used
  * Cache visible actions
  * Lazily load the UrlRewriter
  * Make etag an ivar that is set on prepare!
2009-08-11 15:03:53 -07:00
Yehuda Katz
9e62d6d1c0 Tentatively accept the ":as or :object, but not both" solution 2009-08-11 15:03:53 -07:00
Yehuda Katz
02d9dd9000 Add some more caching to the lookup 2009-08-11 15:03:52 -07:00
codeape
8c32248acb Introduce grouped_collection_select helper.
[#1249 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-09 23:58:43 -07:00
Joshua Peek
734e903af5 Deprecate router generation "best match" sorting 2009-08-09 22:53:16 -05:00
Max Lapshin
0af4b0755f Make sure link_to generates the form with the specified :href if any [#2254 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-10 00:58:40 +01:00
Matt Duncan
920ef4e6f3 Fixed to_label_tag to accept id attribute without changing for attribute [#2660 status:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2009-08-09 23:54:21 +01:00
Hugo Peixoto
202b091373 Added both the documentation and a test case for the collection path name customization feature.
[#1218 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-09 14:26:36 -07:00
Jeremy Kemper
c2f9c42719 Fix that RedCloth shouldn't be required to run tests 2009-08-09 11:02:34 -07:00
Felipe Talavera
654568e71b Allow to configure trusted proxies via ActionController::Base.trusted_proxies [#2126 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-09 16:56:18 +01:00
rizwanreza
7dbb2b6f83 Support passing Redcloth options via textilize helper [#2973 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-09 16:41:09 +01:00
José Valim
32bde66aa6 Make http digest work with different server/browser combinations
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-09 15:53:52 +01:00
Yehuda Katz
e28e061165 Use response_body rather than performed? 2009-08-09 04:12:09 -03:00
Yehuda Katz
964bc4e855 Rendering a template from ActionView will default to looking for partials only in the current mime type.
* The old behavior was tested only as a side-effect of a different test--the original tests remain;
    a new template in the XML mime was added.
  * If you are relying on the current behavior and object to this change, please participate in
    http://groups.google.com/group/rubyonrails-core/browse_thread/thread/6ef25f3c108389bd
2009-08-09 04:12:08 -03:00
Yehuda Katz
d7415f792c Clean up partial object some more; replace passing around a block to a single block ivar 2009-08-09 04:12:08 -03:00
Michael Koziarski
b97d293374 Merge branch 'patches' 2009-08-09 13:10:14 +12:00
Michael Koziarski
370bf1401a Don't call additional methods on builders passed to the atom_feed helper.
Additionally, actually test that the atom_feed helper works with :xml as an option.

[#1836 state:committed]
2009-08-09 13:10:08 +12:00
Jon Wood
271baf235d Add :redirect to the testable RJS statements [#2612 state:resolved]
Example :
  assert_select_rjs :redirect, root_path

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-09 02:00:15 +01:00
Jan Schwenzien
1f6afe4a74 Fix HTTP basic authentication for long credentials [#2572 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-09 01:28:43 +01:00
rizwanreza
5786395760 Allow content_tag options to take an array [#1741 state:resolved] [rizwanreza, Nick Quaranto]
Example:
  content_tag('p', "limelight", :class => ["song", "play"])
  # => <p class="song play">limelight</p>

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-08 22:21:32 +01:00
Dan Croak
00544c778f Add test ensuring redirect_to uses the given protocol [#2886]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-08 20:48:39 +01:00
José Valim
c34d6279a0 Allow radio buttons to work with booleans.
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-08 18:02:07 +01:00
rizwanreza
1191e3ffaf Add :include_blank option for select_tag [#1987 status:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-08 17:58:27 +01:00
Niklas Holmgren
c284412b14 Polymorphic routes generates collection URL from model class [#1089 state:resolved]
Signed-off-by: Dan Pickett <dpickett@enlightsolutions.com>
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-08 17:00:29 +01:00
Yehuda Katz
ad98827a78 Merge commit 'jose/responder' 2009-08-08 12:54:02 -03:00
José Valim
6e0ac748e4 Renamed ActionController::Renderer to ActionController::Responder and ActionController::MimeResponds::Responder to ActionController::MimeResponds::Collector. 2009-08-08 17:48:07 +02:00
Yehuda Katz
efcfce50c4 Fixes "Cached fragment hit" written to log even if fragment is not cached (Erik Andrejko) [#2917 state:resolved] 2009-08-08 12:46:44 -03:00
wmoxam
98450fd168 Fix number_to_precision rounding error [#2071 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-08 02:05:10 +01:00
Jeremy Kemper
43b406bdb0 Ruby 1.9 compat: fix route recognition encoding test 2009-08-07 17:16:34 -07:00
Yehuda Katz
010a0c92eb Rename find_by_parts and find_by_parts? to find and exists? 2009-08-07 15:00:12 -03:00
José Valim
aed135d3e2 Renamed presenter to renderer, added some documentation and defined its API. 2009-08-07 17:17:51 +02:00
José Valim
1fd65c80fc Encapsulate respond_with behavior in a presenter. 2009-08-07 17:16:16 +02:00
José Valim
7034272354 Add destroyed? to ActiveRecord, include tests for polymorphic urls for destroyed objects and refactor mime responds tests and documentation. 2009-08-07 17:16:16 +02:00
José Valim
f59984cc81 Add nagivational behavior to respond_with. 2009-08-07 17:16:15 +02:00
José Valim
dac8927b05 Merge branch 'master' of git://github.com/rails/rails into old 2009-08-07 16:10:17 +02:00
Yehuda Katz
0612fd0f09 Replace _render_template_with_layout with _render_template since the layout is optional 2009-08-07 03:18:45 -03:00
Yehuda Katz
70a440aa27 Clean up render @object a bit more. 2009-08-07 00:52:13 -03:00
Yehuda Katz
71638e6760 Move AbstractController to a top-level component 2009-08-06 22:51:24 -03:00
Yehuda Katz
af375a5eb3 Replace _action_view with view_context to reflect that it is public and that it does not need to be an ActionView instance 2009-08-06 19:45:40 -03:00
Matthew Rudy Jacobs
64268a0b06 Make sure javascript_include_tag/stylesheet_link_tag does not append ".js" or ".css" onto external urls [#1664 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-05 15:58:55 +01:00
Yehuda Katz
b53f006901 Remove legacy processing and content_length
* convert_content_type! is handled by assign_default_content_type_and_charset!
  * set_content_length! should be handled by the endpoint server. Otherwise
    each middleware that modifies the body has to do the expensive work of
    recalculating content_length.
  * convert_language! appears to be legacy. There are no tests for this
  * convert_cookies! should be handled by the new HeaderHash in Rack
  * Use an integer for .status's internal representation to avoid needing to
    do String manipulation just to find out the status
2009-08-02 19:39:33 -04:00
Yehuda Katz
503ce1d01c Update cache_control to be a Hash of options that is used to build the header.
* Significantly simplifies setting and modifying cache control in other areas
2009-08-02 19:39:33 -04:00
Jeremy Kemper
f2a35723c8 Ruby 1.9: fix encoding for test_file_stream 2009-08-01 20:26:05 -07:00
Sava Chankov
ec94c2550d Ruby 1.9: fix Content-Length for multibyte send_data streaming
[#2661 state:resolved]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-01 20:25:59 -07:00
José Valim
b2d24baf79 Added tests for nested resources. 2009-07-31 20:56:53 +02:00
José Valim
5b7e81efec Allow respond_with to deal with http verb accordingly. 2009-07-31 11:59:05 +02:00
Marc Love
d860c89170 Fix tag helpers so that all HTML element boolean attributes render according to the specs. Added all boolean attributes listed in the XHTML 1.0 specs (http://www.w3.org/TR/xhtml1/guidelines.html) and HTML 5 specs (http://www.whatwg.org/specs/web-apps/current-work). HTML 5 boolean attribute rendering was broken in commit 1e2d7229602f467cfdc0ef606b5ef8a5566a1501 / [#2864 state:resolved].
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-07-30 09:48:27 -07:00
José Valim
d209aea7d8 Remove last TODO.
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-07-29 12:06:04 -07:00
José Valim
fa0cf663fe Add a couple more tests to respond_with.
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-07-29 12:06:03 -07:00
José Valim
09de34ca56 Added respond_with.
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-07-29 12:06:03 -07:00
José Valim
bbe86077c2 Added tests for respond_to class method.
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-07-29 12:06:03 -07:00
José Valim
67b2d08c0a Ensure that the proper accept header value is set during tests.
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-07-29 12:06:03 -07:00
José Valim
b51632d34d Improve request test coverage by adding formats and negotiate_mime tests.
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-07-29 12:06:02 -07:00
José Valim
3e8ba616ef Refactor even more Responder. Move mime negotiation to request and added respond_to class method.
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-07-29 12:06:02 -07:00
José Valim
3f445b316d Refactor Responder to only calculate available mime types. Those are sent to the controller that knows what to do with it (render a block or call default render).
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-07-29 12:06:02 -07:00
Yehuda Katz
c4d1075bd3 Add support for error_messages_for(@obj) 2009-07-28 19:06:14 -07:00
Pratik Naik
9533e0eca7 Ignore everything under test/fixtures/public/absolute 2009-07-27 17:21:52 +01:00
Joshua Peek
92c00d7586 AMo conversion helper 2009-07-21 00:51:57 -05:00
Yehuda Katz
d80316ad32 First effort at new Ajax helpers 2009-07-20 16:13:21 -07:00
Yehuda Katz
f2f5cdc8bc Rename ActiveRecordHelper to ActiveModelHelper 2009-07-20 01:30:49 +09:00
Yehuda Katz
b00cac4adc Finish convert_to_object updates 2009-07-20 01:22:24 +09:00
Yehuda Katz
13e18dd940 Update some tests and add a to_model to form helpers 2009-07-20 00:58:59 +09:00
Yehuda Katz
5ffaaa71d1 Define ActiveModel API Compliance
- Define to_model on AR
  - Define to_model on ActiveModel::APICompliant
  - Update test fixtures to be API Compliant
  - Start using to_model in AP
2009-07-20 00:27:04 +09:00
Yehuda Katz
b20d68446d Move default_form_builder to ActionView so it'll work in environments not using ActionView::Base 2009-07-19 22:31:55 +09:00
Yehuda Katz
0f2914be40 Separate ActionView::Context so something else can easily be made into an AV context 2009-07-19 22:31:44 +09:00
Yehuda Katz
bb530923bc Simplify required "ActionView compliant" API 2009-07-19 21:53:02 +09:00
Emilio Tagua
1e2d722960 Adds a audio_tag helper for the HTML5 audio tag. Fixed video_path docs. HTML attributes values should be true or false not attribute's name. [#2864 state:resolved]
Signed-off-by: Yehuda Katz <wycats@yehuda-katzs-macbookpro41.local>
2009-07-07 15:56:27 -07:00
Jesús García Sáez
fc6077d76e Allow symbols on routes declaration (:controller and :action values) [#2828 state:resolved]
Signed-off-by: Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>
2009-07-02 12:18:48 -07:00
Jarl Friis
e61afed6f8 My suggestion to fix ticket 2401 [#2401 state:resolved]
Signed-off-by: Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>
2009-07-02 11:55:24 -07:00
Yehuda Katz + Carl Lerche
cf5b2b250f Fixes a number of tests that inexplicably didn't fail when we committed the original patch 2009-07-02 10:50:25 -07:00
Tieg Zaharia
51d7b3070c Adds a video_tag helper for the HTML5 video tag (similar to how the image_tag works) (tests included); removes a duplicate test line for image_tag; adds boolean attributes for video tag to tag()'s boolean attributes
Signed-off-by: Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>
2009-07-02 10:36:38 -07:00
Yehuda Katz + Carl Lerche
7583a24ee0 Move mocha down below initial T::U require and bump version to 0.9.7 [#2858 state:resolved] 2009-07-01 11:53:17 -07:00
Yehuda Katz + Carl Lerche
0515256fd3 Accept Symbol for contoller name [#2855 state:resolved]
Signed-off-by: Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>
2009-07-01 11:16:18 -07:00
Chris Mear
085db5e128 Make text_area_tag escape contents by default.
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#2015 state:committed]
2009-06-27 13:16:52 +12:00
Vicente Mundim
68b02cb00a Make filter_parameters work correctly with array parameters. 2009-06-27 12:43:57 +12:00