Module: ActionView::TestCase::Behavior
- Extended by:
- ActiveSupport::Concern
- Includes:
- AbstractController::Helpers, ActionController::RecordIdentifier, ActionController::TemplateAssertions, ActionDispatch::Assertions, ActionDispatch::Routing::PolymorphicRoutes, ActionDispatch::TestProcess, Context, Helpers
- Included in:
- ActionView::TestCase
- Defined in:
- actionpack/lib/action_view/test_case.rb
Defined Under Namespace
Modules: ClassMethods, Locals
Constant Summary
Constants included from Helpers::TagHelper
Helpers::TagHelper::BOOLEAN_ATTRIBUTES, Helpers::TagHelper::PRE_CONTENT_STRINGS
Constants included from ActionController::RecordIdentifier
ActionController::RecordIdentifier::JOIN, ActionController::RecordIdentifier::NEW
Constants included from Helpers::NumberHelper
Helpers::NumberHelper::DECIMAL_UNITS, Helpers::NumberHelper::DEFAULT_CURRENCY_VALUES, Helpers::NumberHelper::STORAGE_UNITS
Constants included from Helpers::JavaScriptHelper
Helpers::JavaScriptHelper::JS_ESCAPE_MAP
Constants included from ActionDispatch::Assertions
ActionDispatch::Assertions::NO_STRIP
Instance Attribute Summary collapse
-
#controller ⇒ Object
Returns the value of attribute controller.
-
#output_buffer ⇒ Object
Returns the value of attribute output_buffer.
-
#rendered ⇒ Object
Returns the value of attribute rendered.
Attributes included from Context
Instance Method Summary collapse
- #config ⇒ Object
- #locals ⇒ Object
- #render(options = {}, local_assigns = {}, &block) ⇒ Object
- #setup_with_controller ⇒ Object
Methods included from ActiveSupport::Concern
append_features, extended, included
Methods included from ActiveSupport::Autoload
#autoload, #autoload_at, #autoload_under, #autoloads, #eager_autoload, eager_autoload!
Methods included from Helpers::UrlHelper
#_routes_context, #button_to, #current_page?, #link_to, #link_to_if, #link_to_unless, #link_to_unless_current, #mail_to, #url_for, #url_options
Methods included from Helpers::TagHelper
#cdata_section, #content_tag, #escape_once, #tag
Methods included from Helpers::CaptureHelper
#capture, #content_for, #content_for?, #flush_output_buffer, #provide, #with_output_buffer
Methods included from ActionDispatch::Routing::UrlFor
#initialize, #url_for, #url_options
Methods included from ActionDispatch::Routing::PolymorphicRoutes
#polymorphic_path, #polymorphic_url
Methods included from Helpers::TranslationHelper
Methods included from Helpers::TextHelper
#concat, #current_cycle, #cycle, #excerpt, #highlight, #pluralize, #reset_cycle, #safe_concat, #simple_format, #truncate, #word_wrap
Methods included from Helpers::SanitizeHelper
#sanitize, #sanitize_css, #strip_links, #strip_tags
Methods included from Helpers::RenderingHelper
Methods included from Helpers::RecordTagHelper
Methods included from ActionController::RecordIdentifier
Methods included from Helpers::OutputSafetyHelper
Methods included from Helpers::NumberHelper
#number_to_currency, #number_to_human, #number_to_human_size, #number_to_percentage, #number_to_phone, #number_with_delimiter, #number_with_precision
Methods included from Helpers::JavaScriptHelper
#button_to_function, #escape_javascript, #javascript_cdata_section, #javascript_tag, #link_to_function
Methods included from Helpers::FormTagHelper
#button_tag, #check_box_tag, #email_field_tag, #field_set_tag, #file_field_tag, #form_tag, #hidden_field_tag, #image_submit_tag, #label_tag, #number_field_tag, #password_field_tag, #radio_button_tag, #range_field_tag, #search_field_tag, #select_tag, #submit_tag, #telephone_field_tag, #text_area_tag, #text_field_tag, #url_field_tag, #utf8_enforcer_tag
Methods included from Helpers::FormOptionsHelper
#collection_select, #grouped_collection_select, #grouped_options_for_select, #option_groups_from_collection_for_select, #options_for_select, #options_from_collection_for_select, #select, #time_zone_options_for_select, #time_zone_select
Methods included from Helpers::FormHelper
#check_box, #convert_to_model, #email_field, #fields_for, #file_field, #form_for, #hidden_field, #label, #number_field, #password_field, #radio_button, #range_field, #search_field, #telephone_field, #text_area, #text_field, #url_field
Methods included from Helpers::DebugHelper
Methods included from Helpers::DateHelper
#date_select, #datetime_select, #distance_of_time_in_words, #select_date, #select_datetime, #select_day, #select_hour, #select_minute, #select_month, #select_second, #select_time, #select_year, #time_ago_in_words, #time_select, #time_tag
Methods included from Helpers::CsrfHelper
Methods included from Helpers::ControllerHelper
Methods included from Helpers::CacheHelper
Methods included from Helpers::AtomFeedHelper
Methods included from Helpers::AssetTagHelper
#audio_path, #audio_tag, #auto_discovery_link_tag, #favicon_link_tag, #font_path, #image_alt, #image_path, #image_tag, #video_path, #video_tag
Methods included from Helpers::AssetTagHelper::StylesheetTagHelpers
#stylesheet_link_tag, #stylesheet_path
Methods included from Helpers::AssetTagHelper::JavascriptTagHelpers
#javascript_include_tag, #javascript_path
Methods included from ActiveSupport::Benchmarkable
Methods included from Context
#_layout_for, #_prepare_context
Methods included from ActionController::TemplateAssertions
#assert_template, #process, #setup_subscriptions, #teardown_subscriptions
Methods included from ActionDispatch::Assertions::TagAssertions
#assert_no_tag, #assert_tag, #find_all_tag, #find_tag, #html_document
Methods included from ActionDispatch::Assertions::SelectorAssertions
#assert_select, #assert_select_email, #assert_select_encoded, #count_description, #css_select
Methods included from ActionDispatch::Assertions::RoutingAssertions
#assert_generates, #assert_recognizes, #assert_routing, #with_routing
Methods included from ActionDispatch::Assertions::ResponseAssertions
#assert_redirected_to, #assert_response
Methods included from ActionDispatch::Assertions::DomAssertions
#assert_dom_equal, #assert_dom_not_equal
Methods included from ActionDispatch::TestProcess
#assigns, #cookies, #fixture_file_upload, #flash, #redirect_to_url, #session
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(selector, *args) ⇒ Object (private)
230 231 232 233 234 235 236 237 238 |
# File 'actionpack/lib/action_view/test_case.rb', line 230 def method_missing(selector, *args) if @controller.respond_to?(:_routes) && ( @controller._routes.named_routes.helpers.include?(selector) || @controller._routes.mounted_helpers.method_defined?(selector) ) @controller.__send__(selector, *args) else super end end |
Instance Attribute Details
#controller ⇒ Object
Returns the value of attribute controller
49 50 51 |
# File 'actionpack/lib/action_view/test_case.rb', line 49 def controller @controller end |
#output_buffer ⇒ Object
Returns the value of attribute output_buffer
49 50 51 |
# File 'actionpack/lib/action_view/test_case.rb', line 49 def output_buffer @output_buffer end |
#rendered ⇒ Object
Returns the value of attribute rendered
49 50 51 |
# File 'actionpack/lib/action_view/test_case.rb', line 49 def rendered @rendered end |
Instance Method Details
#config ⇒ Object
109 110 111 |
# File 'actionpack/lib/action_view/test_case.rb', line 109 def config @controller.config if @controller.respond_to?(:config) end |
#locals ⇒ Object
119 120 121 |
# File 'actionpack/lib/action_view/test_case.rb', line 119 def locals @locals ||= {} end |
#render(options = {}, local_assigns = {}, &block) ⇒ Object
113 114 115 116 117 |
# File 'actionpack/lib/action_view/test_case.rb', line 113 def render( = {}, local_assigns = {}, &block) view.assign(view_assigns) @rendered << output = view.render(, local_assigns, &block) output end |
#setup_with_controller ⇒ Object
99 100 101 102 103 104 105 106 107 |
# File 'actionpack/lib/action_view/test_case.rb', line 99 def setup_with_controller @controller = ActionView::TestCase::TestController.new @request = @controller.request @output_buffer = ActiveSupport::SafeBuffer.new @rendered = '' make_test_case_available_to_view! say_no_to_protect_against_forgery! end |