Sha256: 5822a98ad68201eaaaca6e2bb539c3c37033aa5a5fc04e8539d4a7295f451065

Contents?: true

Size: 1.11 KB

Versions: 2

Compression:

Stored size: 1.11 KB

Contents

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
unless defined? JRUBY_VERSION
  require 'simplecov'
  SimpleCov.start 'rails'
end

require 'rspec'
require 'active_record'
require 'action_view'
require 'active_support'
require 'active_support/test_case'
require 'action_controller'
require 'action_controller/test_case'
require 'action_dispatch'
require 'rails_paginate'

# Requires supporting files with custom matchers and macros, etc,
# in ./support/ and its subdirectories.
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }

RSpec.configure do |config|
  def action_view
    x = ActionView::Base.new
    x.controller = action_controller
    x.request = action_controller.request
    x
  end

  def action_controller
    x = DummyController.new
    x.request = test_request
    x.response = test_response
    x
  end

  def routes
    ActionDispatch::Routing::RouteSet.new.draw { root :to => "index#dummy" }
  end

  def test_request
    ActionController::TestRequest.new
  end

  def test_response
    ActionController::TestResponse.new
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rails_paginate-0.0.4 spec/spec_helper.rb
rails_paginate-0.0.3 spec/spec_helper.rb