spec/spec_helper.rb in activity_notification-1.7.0 vs spec/spec_helper.rb in activity_notification-1.7.1

- old
+ new

@@ -13,15 +13,20 @@ ] SimpleCov.start('rails') do add_filter '/spec/' add_filter '/lib/generators/templates/' add_filter '/lib/activity_notification/version.rb' - if Rails::VERSION::MAJOR == 5 - nocov_token 'skip-rails5' - elsif Rails::VERSION::MAJOR == 4 - nocov_token 'skip-rails4' + if Rails::VERSION::MAJOR >= 5 + nocov_token 'except-rails5+' + else + nocov_token 'only-rails5+' end + if Gem::Version.new("5.1.6") <= Rails.gem_version && Rails.gem_version < Gem::Version.new("5.2.2") + nocov_token 'only-rails-without-callback-issue' + else + nocov_token 'only-rails-with-callback-issue' + end if ENV['AN_ORM'] == 'mongoid' add_filter '/lib/activity_notification/orm/active_record' else add_filter '/lib/activity_notification/orm/mongoid' end @@ -34,9 +39,11 @@ require 'rspec/rails' require 'ammeter/init' require 'factory_bot_rails' require 'activity_notification' + +Dir[Rails.root.join("../../spec/support/**/*.rb")].each { |file| require file } def clear_database [ActivityNotification::Notification, ActivityNotification::Subscription, Comment, Article, Admin, User].each do |model_class| model_class.delete_all end