spec/spec_helper.rb in activity_notification-2.0.0 vs spec/spec_helper.rb in activity_notification-2.1.0
- old
+ new
@@ -12,34 +12,26 @@
Coveralls::SimpleCov::Formatter
]
SimpleCov.start('rails') do
add_filter '/spec/'
add_filter '/lib/generators/templates/'
- add_filter '/lib/activity_notification/version.rb'
- if Rails::VERSION::MAJOR >= 5
- skip_token_tag = 'except-rails5-plus'
- else
- skip_token_tag = 'only-rails5-plus'
- add_filter '/app/channels/activity_notification/'
- end
- if Gem::Version.new("5.1.6") <= Rails.gem_version && Rails.gem_version < Gem::Version.new("5.2.2")
- skip_token_tag += '#only-rails-without-callback-issue'
- else
- skip_token_tag += '#only-rails-with-callback-issue'
- end
+ 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'
- skip_token_tag += '#except-dynamoid'
else
add_filter '/lib/activity_notification/orm/mongoid'
add_filter '/lib/activity_notification/orm/dynamoid'
end
- skip_token skip_token_tag
+ if Rails::VERSION::MAJOR < 5
+ add_filter '/app/channels/'
+ add_filter '/lib/activity_notification/optional_targets/action_cable_channel'
+ add_filter '/lib/activity_notification/optional_targets/action_cable_api_channel'
+ end
end
# Dummy application
require 'rails_app/config/environment'
@@ -57,10 +49,10 @@
end
end
RSpec.configure do |config|
config.include FactoryBot::Syntax::Methods
- config.before(:all) do
+ config.before(:each) do
FactoryBot.reload
clean_database
end
config.include Devise::Test::ControllerHelpers, type: :controller
end