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 S.
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 S.
Hi John,
On Sat, 2009-08-08 at 17:00 +0200, John S. wrote:
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
bill walton wrote:
Hi John,
On Sat, 2009-08-08 at 17:00 +0200, John S. wrote:
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/environmentsHTH,
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 S.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs