Class: ActionView::Base

Inherits:
Object show all
Includes:
Spec::Rails::Example::RenderObserver
Defined in:
lib/vendor/plugins/rspec-rails/lib/spec/rails/extensions/action_view/base.rb

Overview

:nodoc:

Instance Method Summary collapse

Methods included from Spec::Rails::Example::RenderObserver

#register_verify_after_each, #render_proxy, #should_not_receive, #should_receive, #stub, #stub!, #unregister_verify_after_each, #verify_rendered, #verify_rendered_proc

Instance Method Details

#render_partial_with_base_view_path_handling(partial_path, local_assigns = nil, deprecated_local_assigns = nil) ⇒ Object

:nodoc:



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/vendor/plugins/rspec-rails/lib/spec/rails/extensions/action_view/base.rb', line 6

def render_partial_with_base_view_path_handling(partial_path, local_assigns = nil, deprecated_local_assigns = nil) #:nodoc:
  if partial_path.is_a?(String)
    unless partial_path.include?("/")
      unless self.class.base_view_path.nil?
        partial_path = "#{self.class.base_view_path}/#{partial_path}"
      end
    end
  end
  begin
    render_partial_without_base_view_path_handling(partial_path, local_assigns, deprecated_local_assigns)
  rescue ArgumentError # edge rails > 2.1 changed render_partial to accept only one arg
    render_partial_without_base_view_path_handling(partial_path)
  end
end

#render_with_mock_proxy(options = {}, old_local_assigns = {}, &block) ⇒ Object



22
23
24
25
26
27
28
29
30
# File 'lib/vendor/plugins/rspec-rails/lib/spec/rails/extensions/action_view/base.rb', line 22

def render_with_mock_proxy(options = {}, old_local_assigns = {}, &block)
  if render_proxy.__send__(:__mock_proxy).__send__(:find_matching_expectation, :render, options)
    render_proxy.render(options)
  else
    unless render_proxy.__send__(:__mock_proxy).__send__(:find_matching_method_stub, :render, options)
      render_without_mock_proxy(options, old_local_assigns, &block)
    end
  end
end