set only one observer to be active in a test

In my environment.rb I set a whole bunch of observers to be active by
default. In testing I don't want to do that, I want to turn observers on
and off as required so that I can isolate the things I'm testing.

How do I do it?

Ta

John Small

Hi John,

bill walton wrote:

Hi John,

In my environment.rb I set a whole bunch of observers to be active by
default. In testing I don't want to do that, I want to turn observers on
and off as required so that I can isolate the things I'm testing.

How do I do it?

The settings in environment.rb are over-ridden by the settings in the
environment-specific configs. Surest way to make this happen is to not
put them in environment.rb but rather to specify the ones you want to
run in each mode in the appropriate file in config/environments

HTH,
Bill

well yes, but what I really need is test specific settings for my
observers. What I don't want is to be testing the observers for a model,
when I should be testing the model on its own and testing the observers
separately. If I start the observers running in the appropriate file in
config/environments then they'll be running for all my tests. How do I
stop and start them inside my tests?

Ta

John Small