Sha256: b7d8c1620b35d07fca69826915b3efd20266781a761722658a5c324aa046a83b

Contents?: true

Size: 1.63 KB

Versions: 5

Compression:

Stored size: 1.63 KB

Contents

ENV["RAILS_ENV"] ||= "test"
Warning[:deprecated] = true if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.7.2")

require 'bundler/setup'
Bundler.setup

require 'simplecov'
require 'coveralls'
require 'rails'
Coveralls.wear!
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new [
  SimpleCov::Formatter::HTMLFormatter,
  Coveralls::SimpleCov::Formatter
]
SimpleCov.start('rails') do
  add_filter '/spec/'
  add_filter '/lib/generators/templates/'
  add_filter '/lib/activity_notification/version'
  if ENV['AN_ORM'] == 'mongoid'
    add_filter '/lib/activity_notification/orm/active_record'
    add_filter '/lib/activity_notification/orm/dynamoid'
  elsif ENV['AN_ORM'] == 'dynamoid'
    add_filter '/lib/activity_notification/orm/active_record'
    add_filter '/lib/activity_notification/orm/mongoid'
  else
    add_filter '/lib/activity_notification/orm/mongoid'
    add_filter '/lib/activity_notification/orm/dynamoid'
  end
end

# Dummy application
require 'rails_app/config/environment'

require 'rspec/rails'
require 'ammeter/init'
require "action_cable/testing/rspec" if Rails::VERSION::MAJOR == 5
require 'factory_bot_rails'
require 'activity_notification'

Dir[Rails.root.join("../../spec/support/**/*.rb")].each { |file| require file }

def clean_database
  [ActivityNotification::Notification, ActivityNotification::Subscription, Comment, Article, Admin, User].each do |model_class|
    model_class.delete_all
  end
end

RSpec.configure do |config|
  config.include FactoryBot::Syntax::Methods
  config.before(:each) do
    FactoryBot.reload
    clean_database
  end
  config.include Devise::Test::ControllerHelpers, type: :controller
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
activity_notification-2.2.4 spec/spec_helper.rb
activity_notification-2.2.3 spec/spec_helper.rb
activity_notification-2.2.2 spec/spec_helper.rb
activity_notification-2.2.1 spec/spec_helper.rb
activity_notification-2.2.0 spec/spec_helper.rb