Sha256: 2d19dc65f39f0350f2999a78db2f433069216b9ab20748b95b469eedabfe8202

Contents?: true

Size: 1.13 KB

Versions: 12

Compression:

Stored size: 1.13 KB

Contents

module ActionView #:nodoc:
  class Base #:nodoc:
    include Spec::Rails::Example::RenderObserver
    cattr_accessor :base_view_path
    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
        super(partial_path, local_assigns, deprecated_local_assigns)
      rescue ArgumentError # edge rails > 2.1 changed render_partial to accept only one arg
        super(partial_path)
      end
    end

    alias_method :orig_render, :render
    def render(options = {}, old_local_assigns = {}, &block)
      if expect_render_mock_proxy.send(:__mock_proxy).send(:find_matching_expectation, :render, options)
        expect_render_mock_proxy.render(options)
      else
        unless expect_render_mock_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

12 entries across 12 versions & 2 rubygems

Version Path
jnstq-acts_as_sms-0.1.0 test/vendor/plugins/rspec-rails/lib/spec/rails/extensions/action_view/base.rb
jnstq-acts_as_sms-0.1.1 test/vendor/plugins/rspec-rails/lib/spec/rails/extensions/action_view/base.rb
jnstq-acts_as_sms-0.1.3 test/vendor/plugins/rspec-rails/lib/spec/rails/extensions/action_view/base.rb
jnstq-acts_as_sms-0.1.4 test/vendor/plugins/rspec-rails/lib/spec/rails/extensions/action_view/base.rb
jstorimer-deep-test-2.0.0 sample_rails_project/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/action_view/base.rb
jstorimer-deep-test-1.4.0 sample_rails_project/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/action_view/base.rb
jstorimer-deep-test-1.3.0 sample_rails_project/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/action_view/base.rb
jstorimer-deep-test-1.2.0 sample_rails_project/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/action_view/base.rb
jstorimer-deep-test-1.1.0 sample_rails_project/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/action_view/base.rb
jstorimer-deep-test-1.0.0 sample_rails_project/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/action_view/base.rb
jstorimer-deep-test-0.2.0 sample_rails_project/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/action_view/base.rb
jstorimer-deep-test-0.1.0 sample_rails_project/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/action_view/base.rb