Sha256: b5c88e45e935d292bfbe3517ddf55c5b4ed0f5549e9ee117de81bdb4d504043d

Contents?: true

Size: 754 Bytes

Versions: 7

Compression:

Stored size: 754 Bytes

Contents

require 'rspec/core'
require 'rspec/matchers'
require 'paper_trail/frameworks/rspec/helpers'

RSpec.configure do |config|
  config.include ::PaperTrail::RSpec::Helpers::InstanceMethods
  config.extend ::PaperTrail::RSpec::Helpers::ClassMethods

  config.before(:each) do
    ::PaperTrail.enabled = false
    ::PaperTrail.enabled_for_controller = true
    ::PaperTrail.whodunnit = nil
    ::PaperTrail.controller_info = {} if defined?(::Rails) && defined?(::RSpec::Rails)
  end

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

RSpec::Matchers.define :be_versioned do
  # check to see if the model has `has_paper_trail` declared on it
  match { |actual| actual.kind_of?(::PaperTrail::Model::InstanceMethods) }
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
paper_trail-3.0.9 lib/paper_trail/frameworks/rspec.rb
paper_trail-3.0.8 lib/paper_trail/frameworks/rspec.rb
paper_trail-3.0.7 lib/paper_trail/frameworks/rspec.rb
paper_trail-3.0.6 lib/paper_trail/frameworks/rspec.rb
paper_trail-3.0.5 lib/paper_trail/frameworks/rspec.rb
paper_trail-3.0.2 lib/paper_trail/frameworks/rspec.rb
paper_trail-3.0.1 lib/paper_trail/frameworks/rspec.rb