Sha256: 566476c332dce2e5ac8a9d53213962386512db763f3112bfcbf4edc01cfbc4ad

Contents?: true

Size: 728 Bytes

Versions: 27

Compression:

Stored size: 728 Bytes

Contents

# frozen_string_literal: true

# before hook for Cucumber
Before do
  PaperTrail.enabled = false
  PaperTrail.request.enabled = true
  PaperTrail.request.whodunnit = nil
  PaperTrail.request.controller_info = {} if defined?(::Rails)
end

module PaperTrail
  module Cucumber
    # Helper method for enabling PT in Cucumber features.
    module Extensions
      # :call-seq:
      # with_versioning
      #
      # enable versioning for specific blocks

      def with_versioning
        was_enabled = ::PaperTrail.enabled?
        ::PaperTrail.enabled = true
        begin
          yield
        ensure
          ::PaperTrail.enabled = was_enabled
        end
      end
    end
  end
end

World PaperTrail::Cucumber::Extensions

Version data entries

27 entries across 27 versions & 3 rubygems

Version Path
paper_trail-16.0.0 lib/paper_trail/frameworks/cucumber.rb
paper_trail-15.2.0 lib/paper_trail/frameworks/cucumber.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/paper_trail-12.3.0/lib/paper_trail/frameworks/cucumber.rb
paper_trail-15.1.0 lib/paper_trail/frameworks/cucumber.rb
paper_trail-15.0.0 lib/paper_trail/frameworks/cucumber.rb
paper_trail-14.0.0 lib/paper_trail/frameworks/cucumber.rb
paper_trail-13.0.0 lib/paper_trail/frameworks/cucumber.rb
paper_trail-12.3.0 lib/paper_trail/frameworks/cucumber.rb
paper_trail-12.2.0 lib/paper_trail/frameworks/cucumber.rb
paper_trail-12.1.0 lib/paper_trail/frameworks/cucumber.rb
paper_trail-12.0.0 lib/paper_trail/frameworks/cucumber.rb
paper_trail-11.1.0 lib/paper_trail/frameworks/cucumber.rb
mongo_trails-10.3.1 lib/mongo_trails/frameworks/cucumber.rb
paper_trail-11.0.0 lib/paper_trail/frameworks/cucumber.rb
paper_trail-10.3.1 lib/paper_trail/frameworks/cucumber.rb
paper_trail-10.3.0 lib/paper_trail/frameworks/cucumber.rb
paper_trail-10.2.1 lib/paper_trail/frameworks/cucumber.rb
paper_trail-10.2.0 lib/paper_trail/frameworks/cucumber.rb
paper_trail-10.1.0 lib/paper_trail/frameworks/cucumber.rb
paper_trail-10.0.1 lib/paper_trail/frameworks/cucumber.rb