spec/spec_helper.rb in ros-apartment-2.3.0 vs spec/spec_helper.rb in ros-apartment-2.4.0
- old
+ new
@@ -1,11 +1,13 @@
+# frozen_string_literal: true
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
# Configure Rails Environment
-ENV["RAILS_ENV"] = "test"
+ENV['RAILS_ENV'] = 'test'
-require File.expand_path("../dummy/config/environment.rb", __FILE__)
+require File.expand_path('dummy/config/environment.rb', __dir__)
# Loading dummy applications affects table_name of each excluded models
# defined in `spec/dummy/config/initializers/apartment.rb`.
# To make them pristine, we need to execute below lines.
Apartment.excluded_models.each do |model|
@@ -14,30 +16,30 @@
Apartment.connection_class.remove_connection(klass)
klass.clear_all_connections!
klass.reset_table_name
end
-require "rspec/rails"
+require 'rspec/rails'
require 'capybara/rspec'
require 'capybara/rails'
begin
require 'pry'
- silence_warnings{ IRB = Pry }
+ silence_warnings { IRB = Pry }
rescue LoadError
+ nil
end
ActionMailer::Base.delivery_method = :test
ActionMailer::Base.perform_deliveries = true
-ActionMailer::Base.default_url_options[:host] = "test.com"
+ActionMailer::Base.default_url_options[:host] = 'test.com'
Rails.backtrace_cleaner.remove_silencers!
# Load support files
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
RSpec.configure do |config|
-
config.include RSpec::Integration::CapybaraSessions, type: :request
config.include Apartment::Spec::Setup
# Somewhat brutal hack so that rails 4 postgres extensions don't modify this file
config.after(:all) do