spec/configuration_spec.rb in ledermann-rails-settings-2.4.3 vs spec/configuration_spec.rb in ledermann-rails-settings-2.5.0
- old
+ new
@@ -59,9 +59,21 @@
end
expect(Dummy.default_settings).to eq({ :dashboard => {}, :calendar => {} })
expect(Dummy.setting_object_class_name).to eq('MyClass')
end
+
+ context 'persistent' do
+ it "should keep settings between multiple configurations initialization" do
+ Configuration.new(Dummy, :persistent => true) do |c|
+ c.key :dashboard, :defaults => { :theme => 'red' }
+ end
+
+ Configuration.new(Dummy, :calendar, :persistent => true)
+
+ expect(Dummy.default_settings).to eq({ :dashboard => { 'theme' => 'red' }, :calendar => {} })
+ end
+ end
end
describe Configuration, 'failure' do
it "should fail without args" do
expect {