Sha256: 01fbee21fefcaf3260a53f3c7a9d7160a5dacc51da80202923ea75899acce2d3

Contents?: true

Size: 372 Bytes

Versions: 3

Compression:

Stored size: 372 Bytes

Contents

RSpec.configure do |config|

  config.before do

    # Disable all observers
    ActiveRecord::Base.observers.disable :all

    # Find out which observers this spec needs
    observers = example.metadata[:observer] || example.metadata[:observers]

    # Turn on observers as needed
    if observers
      ActiveRecord::Base.observers.enable *observers
    end

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
feeder-0.5.1 spec/support/observers.rb
feeder-0.3.0 spec/support/observers.rb
feeder-0.2.0 spec/support/observers.rb