Sha256: df26a365cb63a424ee7dc722f0bccecba700dc0ba69107f936a4360ab6f1c8dd

Contents?: true

Size: 1.32 KB

Versions: 11

Compression:

Stored size: 1.32 KB

Contents

require 'simplecov'
require 'simplecov-rcov'
SimpleCov.formatter = SimpleCov::Formatter::RcovFormatter
SimpleCov.start do
  minimum_coverage 80
  add_filter "/spec/"
  add_filter "/config/"
end

ENV['RAILS_ENV'] ||= 'test'

require File.expand_path("../test_app/config/environment",  __FILE__)
require File.expand_path("../../lib/notifiable",  __FILE__)
require File.expand_path("../../app/controllers/notifiable/device_tokens_controller",  __FILE__)
require 'database_cleaner'
require 'rspec/rails'
require 'rspec/autorun'
require 'factory_girl_rails'

Rails.backtrace_cleaner.remove_silencers!

Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }

DatabaseCleaner.strategy = :truncation

RSpec.configure do |config|  
  config.mock_with :rspec
  config.use_transactional_fixtures = true
  config.infer_base_class_for_anonymous_controllers = false
  config.order = "random"
  config.include EngineControllerTestMonkeyPatch, :type => :controller
  config.include Requests::JsonHelpers, :type => :controller
  
  config.before(:each) {
    DatabaseCleaner.start
    Notifiable.delivery_method = :send
  }
  
  config.after(:each) {
    DatabaseCleaner.clean
  }
end

class MockNotifier < Notifiable::NotifierBase
  def enqueue(device_token)
    processed(device_token, 0)
  end
end

Notifiable.notifier_classes[:mock] = MockNotifier

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
notifiable-rails-0.19.9 spec/spec_helper.rb
notifiable-rails-0.19.7 spec/spec_helper.rb
notifiable-rails-0.19.6 spec/spec_helper.rb
notifiable-rails-0.19.5 spec/spec_helper.rb
notifiable-rails-0.19.4 spec/spec_helper.rb
notifiable-rails-0.19.3 spec/spec_helper.rb
notifiable-rails-0.19.2 spec/spec_helper.rb
notifiable-rails-0.19.1 spec/spec_helper.rb
notifiable-rails-0.19.0 spec/spec_helper.rb
notifiable-rails-0.18.0 spec/spec_helper.rb
notifiable-rails-0.17.0 spec/spec_helper.rb