spec/rails_helper.rb in authz-0.0.1.alpha3 vs spec/rails_helper.rb in authz-0.0.1.alpha4
- old
+ new
@@ -1,15 +1,19 @@
-# This file is copied to spec/ when you run 'rails generate rspec:install'
-require 'spec_helper'
+p 'Loading Rails Helper...'
-
ENV['RAILS_ENV'] ||= 'test'
+ENGINE_ROOT = File.join(File.dirname(__FILE__), '../')
+
require File.expand_path("../dummy/config/environment.rb", __FILE__)
# Prevent database truncation if the environment is production
abort("The Rails environment is running in production mode!") if Rails.env.production?
+
+# This file is copied to spec/ when you run 'rails generate rspec:install'
+require 'spec_helper'
require 'rspec/rails'
# Add additional requires below this line. Rails is not loaded until this point!
+require 'devise'
# Requires supporting ruby files with custom matchers and macros, etc, in
# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
# run as spec files by default. This means that files in spec/support that end
# in _spec.rb will both be required and run as specs, causing the specs to be
@@ -19,17 +23,18 @@
#
# The following line is provided for convenience purposes. It has the downside
# of increasing the boot-up time by auto-requiring all files in the support
# directory. Alternatively, in the individual `*_spec.rb` files, manually
# require only the support files necessary.
-Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
+# Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
+Dir[File.join(ENGINE_ROOT, 'spec/support/**/*.rb')].each { |f| require f }
# Checks for pending migrations and applies them before tests are run.
# If you are not using ActiveRecord, you can remove these lines.
begin
- # ActiveRecord::Migrator.migrations_paths = File.join(ENGINE_ROOT, 'spec/dummy/db/migrate')
+ ActiveRecord::Migrator.migrations_paths = File.join(ENGINE_ROOT, 'spec/dummy/db/migrate')
ActiveRecord::Migration.maintain_test_schema!
rescue ActiveRecord::PendingMigrationError => e
puts e.to_s.strip
exit 1
end
@@ -59,7 +64,11 @@
# Filter lines from Rails gems in backtraces.
config.filter_rails_from_backtrace!
# arbitrary gems may also be filtered via:
# config.filter_gems_from_backtrace("gem name")
+
+ # Devise
+ # config.include Devise::Test::ControllerHelpers, type: :controller
end
+p 'Loaded Rails Helper'
\ No newline at end of file