Sha256: d7987b5835fe28cd8694c01ddcfb167fb0e24943d0076acbaec07b73ed1b90e4

Contents?: true

Size: 1.32 KB

Versions: 29

Compression:

Stored size: 1.32 KB

Contents

module ActionView #:nodoc:
  class Base #:nodoc:
    include Spec::Rails::Example::RenderObserver
    cattr_accessor :base_view_path

    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
    alias_method_chain :render_partial, :base_view_path_handling

    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
    alias_method_chain :render, :mock_proxy
  end
end

Version data entries

29 entries across 29 versions & 6 rubygems

Version Path
cavalle-rspec-rails-1.2.2.0.1 lib/spec/rails/extensions/action_view/base.rb
cavalle-rspec-rails-1.2.2.0.2 lib/spec/rails/extensions/action_view/base.rb
cavalle-rspec-rails-1.2.3.1 lib/spec/rails/extensions/action_view/base.rb
cavalle-rspec-rails-1.2.4.0.1 lib/spec/rails/extensions/action_view/base.rb
dchelimsky-rspec-rails-1.1.99.13 lib/spec/rails/extensions/action_view/base.rb
dchelimsky-rspec-rails-1.1.99.6 lib/spec/rails/extensions/action_view/base.rb
dchelimsky-rspec-rails-1.1.99.7 lib/spec/rails/extensions/action_view/base.rb
dchelimsky-rspec-rails-1.1.99.8 lib/spec/rails/extensions/action_view/base.rb
dchelimsky-rspec-rails-1.1.99.9 lib/spec/rails/extensions/action_view/base.rb
mcmire-rspec-rails-1.1.99.9 lib/spec/rails/extensions/action_view/base.rb
exception2db-0.0.1 test/rspec-rails/lib/spec/rails/extensions/action_view/base.rb
rspec-rails-1.3.2 lib/spec/rails/extensions/action_view/base.rb
rspec-rails-1.3.1 lib/spec/rails/extensions/action_view/base.rb
rspec-rails-1.3.0 lib/spec/rails/extensions/action_view/base.rb
hubbub-0.0.11 lib/vendor/plugins/rspec-rails/lib/spec/rails/extensions/action_view/base.rb
hubbub-0.0.10 lib/vendor/plugins/rspec-rails/lib/spec/rails/extensions/action_view/base.rb
hubbub-0.0.9 lib/vendor/plugins/rspec-rails/lib/spec/rails/extensions/action_view/base.rb
hubbub-0.0.8 lib/vendor/plugins/rspec-rails/lib/spec/rails/extensions/action_view/base.rb
hubbub-0.0.6 lib/vendor/plugins/rspec-rails/lib/spec/rails/extensions/action_view/base.rb
rspec-rails-1.2.9 lib/spec/rails/extensions/action_view/base.rb