Sha256: f7c154cbbd283381d53c244d56aa29c2f765adb3e68587d60a94321c12658a3d

Contents?: true

Size: 1.29 KB

Versions: 10

Compression:

Stored size: 1.29 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.before(:each) {
    DatabaseCleaner.start
    Notifiable.delivery_method = :send
  }
  
  config.after(:each) {
    DatabaseCleaner.clean
  }
end

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

Notifiable.notifier_classes[:mock] = MockNotifier

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
notifiable-rails-0.11.0 spec/spec_helper.rb
notifiable-rails-0.10.1 spec/spec_helper.rb
notifiable-rails-0.10.0 spec/spec_helper.rb
notifiable-rails-0.9.0 spec/spec_helper.rb
notifiable-rails-0.8.0 spec/spec_helper.rb
notifiable-rails-0.7.2 spec/spec_helper.rb
notifiable-rails-0.7.1 spec/spec_helper.rb
notifiable-rails-0.7.0 spec/spec_helper.rb
notifiable-rails-0.6.1 spec/spec_helper.rb
notifiable-rails-0.6.0 spec/spec_helper.rb