Sha256: 301381062aaa524e8270e51e96d5469aa3759704bc8f3b409eaacd226fdfc1ed

Contents?: true

Size: 1.3 KB

Versions: 3

Compression:

Stored size: 1.3 KB

Contents

ENV["RAILS_ENV"] ||= "test"

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.rb'
  if Rails::VERSION::MAJOR == 5
    nocov_token 'skip-rails5'
  elsif Rails::VERSION::MAJOR == 4
    nocov_token 'skip-rails4'
  end
  if ENV['AN_ORM'] == 'mongoid'
    add_filter '/lib/activity_notification/orm/active_record'
  else
    add_filter '/lib/activity_notification/orm/mongoid'
  end
end

# Testing with Devise
require 'devise'
# Dummy application
require 'rails_app/config/environment'

require 'rspec/rails'
require 'ammeter/init'
require 'factory_girl_rails'
require 'activity_notification'

def clear_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 FactoryGirl::Syntax::Methods
  config.before(:all) do
    FactoryGirl.reload
    clear_database
  end
  config.include Devise::Test::ControllerHelpers, type: :controller
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
activity_notification-1.4.3 spec/spec_helper.rb
activity_notification-1.4.2 spec/spec_helper.rb
activity_notification-1.4.1 spec/spec_helper.rb