Sha256: ff5cffc903c21b6080f8479477fb19a00b47fc906d7dfa7d9daccce0372daeac

Contents?: true

Size: 751 Bytes

Versions: 1

Compression:

Stored size: 751 Bytes

Contents

require 'rspec/paper_trail/version'
require 'rspec/paper_trail/extensions'

module RSpec
  module Rails
    class Railtie < ::Rails::Railtie
      initializer 'paper_trail.rspec_extensions' do
        RSpec.configure do |config|
          config.include RSpec::PaperTrailExtensions

          config.before(:each) do
            ::PaperTrail.enabled = false
            ::PaperTrail.controller_info = {}
            ::PaperTrail.whodunnit = nil
          end

          config.before(:each, versioning: true) do
            ::PaperTrail.enabled = true
          end
        end

        RSpec::Matchers.define :be_versioned do
          match do |actual|
            actual.respond_to?(:versions)
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rspec-paper_trail-0.0.10 lib/rspec/paper_trail.rb