aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template
Commit message (Collapse)AuthorAgeFilesLines
* ActionView.url_for doesn't escape by defaultPhil Darnowsky2009-10-151-3/+13
| | | | | | | | | | | | | | | | | 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>
* Start adding configuration to ActionView instead of using constants.Yehuda Katz2009-10-143-0/+16
| | | | | | | 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)
* Fix failing safe buffer test. We don't patch CGI.escapeHTML, only ERB:Util.Joshua Peek2009-10-101-1/+1
|
* Move safe buffer into test/templateJoshua Peek2009-10-101-0/+41
|
* API change: content_tag_for outputs prefixed class nameJoshua Peek2009-10-081-1/+1
|
* Switch to on-by-default XSS escaping for rails.Michael Koziarski2009-10-089-5/+60
| | | | | | | | | | | | 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.
* Use with_routing helper in tests instead of modifying global route setJoshua Peek2009-10-031-14/+23
|
* Moved shared form helper models into fake_modelsJoshua Peek2009-10-032-99/+2
|
* File extra test folders into controller, dispatch, or templateJoshua Peek2009-10-039-0/+1230
|
* Ported the new ActionView::TestCase from 2-3-stable to master [#3260Erik Ostrom2009-09-282-7/+7
| | | | | | | | | | | | | | | | | 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>
* Introduce :almost keyword for distance_of_time_in_words. Make 1.75 days - 2 ↵John Trupiano2009-09-282-21/+37
| | | | | | | days return '2 days'. Signed-off-by: Michael Koziarski <michael@koziarski.com> [#3266 state:committed]
* Enhancing distance_of_time_in_words to prefix year output with over and ↵Jay Pignata2009-09-281-7/+8
| | | | | | | about depending upon how many months have elapsed Signed-off-by: Michael Koziarski <michael@koziarski.com> [#3106 state:committed]
* Restore split between require-time and runtime load path mungery. Simplifies ↵Jeremy Kemper2009-09-241-1/+1
| | | | vendor requires.
* Move helpers specific to functional tests out of TestProcess into AC::TestCaseJoshua Peek2009-09-231-11/+3
|
* Ensure changes to I18n locale get reset during testsJoshua Peek2009-09-191-9/+5
|
* Rollback AS bundler work and improve activation of vendored dependenciesJoshua Peek2009-09-131-1/+1
|
* Define weblog controller for url helper testJoshua Peek2009-09-131-0/+1
|
* Allow fields_for on a nested_attributes association to accept an explicit ↵Andrew France2009-09-121-0/+36
| | | | | | collection to be used. [#2648 state:resolved] Signed-off-by: Eloy Duran <eloy.de.enige@gmail.com>
* Cleanup hacky routing with controller_path in url helper tests. This doesn't ↵Joshua Peek2009-09-061-62/+56
| | | | work in real life anyway.
* Don't raise exceptions for missing javascript_include_tag or ↵Sam Pohlenz2009-09-031-4/+58
| | | | | | stylesheet_link_tag sources unless the :cache or :concat options are given. [#2738 state:resolved] Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Refactor ActionView::ResolverYehuda Katz + Carl Lerche2009-09-031-0/+3
|
* I18n: use I18n for select helpers' prompt textAkira Matsuda2009-08-261-0/+27
| | | | | | [#2252 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Revert "I18n: use I18n for select helpers' prompt text"Jeremy Kemper2009-08-261-22/+0
| | | | | | | | Broke CI. [#2252 state:open] This reverts commit adedf72821a5623227ce91e6b298838e692477e4.
* I18n: use I18n for select helpers' prompt textAkira Matsuda2009-08-261-0/+22
| | | | | | [#2252 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Got tests to pass with some more changes.Yehuda Katz2009-08-153-0/+10
| | | | | | | | | | | | | | | | * 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".
* More cleanup of ActionView and reduction in need for blocks in some cases:Yehuda Katz2009-08-151-1/+1
| | | | | | | | * 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
* Clean up ActionView some:Yehuda Katz2009-08-151-11/+23
| | | | | | | | | | * 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
* Introduce grouped_collection_select helper.codeape2009-08-091-0/+34
| | | | | | [#1249 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Make sure link_to generates the form with the specified :href if any [#2254 ↵Max Lapshin2009-08-101-0/+8
| | | | | | state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Fixed to_label_tag to accept id attribute without changing for attribute ↵Matt Duncan2009-08-091-0/+16
| | | | | | [#2660 status:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Fix that RedCloth shouldn't be required to run testsJeremy Kemper2009-08-091-12/+18
|
* Support passing Redcloth options via textilize helper [#2973 state:resolved]rizwanreza2009-08-091-0/+17
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Use response_body rather than performed?Yehuda Katz2009-08-091-1/+1
|
* Don't call additional methods on builders passed to the atom_feed helper.Michael Koziarski2009-08-091-0/+29
| | | | | | Additionally, actually test that the atom_feed helper works with :xml as an option. [#1836 state:committed]
* Allow content_tag options to take an array [#1741 state:resolved] ↵rizwanreza2009-08-081-0/+13
| | | | | | | | | | [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>
* Allow radio buttons to work with booleans.José Valim2009-08-081-0/+10
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Add :include_blank option for select_tag [#1987 status:resolved]rizwanreza2009-08-081-0/+12
| | | | | Signed-off-by: José Valim <jose.valim@gmail.com> Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Fix number_to_precision rounding error [#2071 state:resolved]wmoxam2009-08-081-0/+1
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Make sure javascript_include_tag/stylesheet_link_tag does not append ".js" ↵Matthew Rudy Jacobs2009-08-051-2/+6
| | | | | | or ".css" onto external urls [#1664 state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Fix tag helpers so that all HTML element boolean attributes render according ↵Marc Love2009-07-301-4/+4
| | | | | | 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>
* Add support for error_messages_for(@obj)Yehuda Katz2009-07-282-2/+15
|
* AMo conversion helperJoshua Peek2009-07-217-17/+33
|
* Rename ActiveRecordHelper to ActiveModelHelperYehuda Katz2009-07-202-2/+2
|
* Finish convert_to_object updatesYehuda Katz2009-07-201-0/+6
|
* Update some tests and add a to_model to form helpersYehuda Katz2009-07-203-6/+7
|
* Define ActiveModel API ComplianceYehuda Katz2009-07-206-18/+23
| | | | | | - Define to_model on AR - Define to_model on ActiveModel::APICompliant - Update test fixtures to be API Compliant - Start using to_model in AP
* Move default_form_builder to ActionView so it'll work in environments not ↵Yehuda Katz2009-07-191-3/+3
| | | | using ActionView::Base
* Separate ActionView::Context so something else can easily be made into an AV ↵Yehuda Katz2009-07-191-1/+1
| | | | context
* Adds a audio_tag helper for the HTML5 audio tag. Fixed video_path docs. HTML ↵Emilio Tagua2009-07-071-4/+36
| | | | | | attributes values should be true or false not attribute's name. [#2864 state:resolved] Signed-off-by: Yehuda Katz <wycats@yehuda-katzs-macbookpro41.local>
* My suggestion to fix ticket 2401 [#2401 state:resolved]Jarl Friis2009-07-021-0/+92
| | | | Signed-off-by: Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>