Sha256: ccd6f1610898361b74acb1b9c87cda3033bf704191ee1787b8eab45a061e0ab9

Contents?: true

Size: 1.18 KB

Versions: 19

Compression:

Stored size: 1.18 KB

Contents

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

    alias_method :orig_render_partial, :render_partial
    def render_partial(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
        orig_render_partial(partial_path, local_assigns, deprecated_local_assigns)
      rescue ArgumentError # edge rails > 2.1 changed render_partial to accept only one arg
        orig_render_partial(partial_path)
      end
    end

    alias_method :orig_render, :render
    def render(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)
          orig_render(options, old_local_assigns, &block)
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 3 rubygems

Version Path
dchelimsky-rspec-rails-1.1.11.1 lib/spec/rails/extensions/action_view/base.rb
dchelimsky-rspec-rails-1.1.11.2 lib/spec/rails/extensions/action_view/base.rb
dchelimsky-rspec-rails-1.1.11.3 lib/spec/rails/extensions/action_view/base.rb
dchelimsky-rspec-rails-1.1.11.4 lib/spec/rails/extensions/action_view/base.rb
dchelimsky-rspec-rails-1.1.11.5 lib/spec/rails/extensions/action_view/base.rb
dchelimsky-rspec-rails-1.1.11.6 lib/spec/rails/extensions/action_view/base.rb
dchelimsky-rspec-rails-1.1.11.7 lib/spec/rails/extensions/action_view/base.rb
dchelimsky-rspec-rails-1.1.12 lib/spec/rails/extensions/action_view/base.rb
dchelimsky-rspec-rails-1.1.99.1 lib/spec/rails/extensions/action_view/base.rb
dchelimsky-rspec-rails-1.1.99.2 lib/spec/rails/extensions/action_view/base.rb
dchelimsky-rspec-rails-1.1.99.3 lib/spec/rails/extensions/action_view/base.rb
dchelimsky-rspec-rails-1.1.99.4 lib/spec/rails/extensions/action_view/base.rb
dchelimsky-rspec-rails-1.1.99.5 lib/spec/rails/extensions/action_view/base.rb
rspec-rails-1.1.12 lib/spec/rails/extensions/action_view/base.rb
spree-0.6.0 vendor/plugins/rspec-rails/lib/spec/rails/extensions/action_view/base.rb
spree-0.7.0 vendor/plugins/rspec-rails/lib/spec/rails/extensions/action_view/base.rb
spree-0.7.1 vendor/plugins/rspec-rails/lib/spec/rails/extensions/action_view/base.rb
spree-0.8.0 vendor/plugins/rspec-rails/lib/spec/rails/extensions/action_view/base.rb
spree-0.8.1 vendor/plugins/rspec-rails/lib/spec/rails/extensions/action_view/base.rb