spec/spec_helper.rb in activeadmin-0.3.4 vs spec/spec_helper.rb in activeadmin-0.4.0
- old
+ new
@@ -1,19 +1,7 @@
-$LOAD_PATH.unshift(File.dirname(__FILE__))
-$LOAD_PATH << File.expand_path('../support', __FILE__)
+require File.expand_path("../spec_helper_without_rails", __FILE__)
-ENV['BUNDLE_GEMFILE'] = File.expand_path('../../Gemfile', __FILE__)
-
-require 'detect_rails_version'
-ENV['RAILS'] = detect_rails_version
-
-require "bundler"
-Bundler.setup
-
-require 'shoulda/active_record'
-include Shoulda::ActiveRecord::Macros
-
module ActiveAdminIntegrationSpecHelper
extend self
def load_defaults!
ActiveAdmin.unload!
@@ -88,13 +76,20 @@
ActionView::Base.send :include, Rails.application.routes.url_helpers
ActionView::Base.new(ActionController::Base.view_paths, assigns, controller)
end
alias_method :action_view, :mock_action_view
+ # A mock resource to register
+ class MockResource
+ end
+
end
ENV['RAILS_ENV'] = 'test'
-ENV['RAILS_ROOT'] = File.expand_path("../rails/rails-#{ENV["RAILS"]}", __FILE__)
+
+require 'detect_rails_version'
+rails_version = detect_rails_version
+ENV['RAILS_ROOT'] = File.expand_path("../rails/rails-#{rails_version}", __FILE__)
# Create the test app if it doesn't exists
unless File.exists?(ENV['RAILS_ROOT'])
system 'rake setup'
end