diff --git a/spec/models/configuration_spec.rb b/spec/models/configuration_spec.rb --- a/spec/models/configuration_spec.rb +++ b/spec/models/configuration_spec.rb @@ -1,14 +1,10 @@ require File.dirname(__FILE__) + '/../spec_helper' -describe Configuration do - - # only work with cached configuration - class Configuration - @@cache = true - end +describe Configuration, "when using cache" do before(:each) do + Configuration.cache = true @int_config = mock(Configuration, :id => 1, :key => 'mode', @@ -27,6 +23,10 @@ :value_type => 'boolean', :value => 'true') end + + after(:each) do + Configuration.cache = false + end it "should retrieve int config" do Configuration.should_receive(:find).once.with(:all).