Sha256: df2c404ede3ae13269c893661c233ac000fc1aa7529169ae6dfad607d674654e

Contents?: true

Size: 720 Bytes

Versions: 25

Compression:

Stored size: 720 Bytes

Contents

require 'rails_helper'
require 'active_admin/helpers/settings'

describe ActiveAdmin::Settings do

  # A Class with settings module included
  let(:klass) do
    Class.new do
      include ActiveAdmin::Settings
    end
  end

  it "should add a new setting with a default" do
    klass.setting :my_setting, "Hello World"
    expect(klass.default_settings[:my_setting]).to eq "Hello World"
  end

  it "should initialize the defaults" do
    klass.setting :my_setting, "Hello World"
    expect(klass.new.my_setting).to eq "Hello World"
  end

  it "should support settings of nil" do
    klass.setting :my_setting, :some_val
    inst = klass.new
    inst.my_setting = nil
    expect(inst.my_setting).to eq nil
  end

end

Version data entries

25 entries across 25 versions & 4 rubygems

Version Path
activeadmin_addons-1.1.2 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-a5a53c3f2b8f/spec/unit/helpers/settings_spec.rb
activeadmin_addons-1.1.1 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-a5a53c3f2b8f/spec/unit/helpers/settings_spec.rb
yousty-activeadmin-1.0.17.pre spec/unit/helpers/settings_spec.rb
yousty-activeadmin-1.0.16.pre spec/unit/helpers/settings_spec.rb
activeadmin_addons-1.1.0 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-a5a53c3f2b8f/spec/unit/helpers/settings_spec.rb
activeadmin_addons-1.0.1 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-a5a53c3f2b8f/spec/unit/helpers/settings_spec.rb
activeadmin_addons-1.0.0 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-a5a53c3f2b8f/spec/unit/helpers/settings_spec.rb
yousty-activeadmin-1.0.15.pre spec/unit/helpers/settings_spec.rb
activeadmin-orac-1.0.0.pre4 spec/unit/helpers/settings_spec.rb
activeadmin-orac-1.0.0 spec/unit/helpers/settings_spec.rb
activeadmin-orac-1.0.0.pre.orac spec/unit/helpers/settings_spec.rb
yousty-activeadmin-1.0.14.pre spec/unit/helpers/settings_spec.rb
yousty-activeadmin-1.0.13.pre spec/unit/helpers/settings_spec.rb
yousty-activeadmin-1.0.12.pre spec/unit/helpers/settings_spec.rb
yousty-activeadmin-1.0.11.pre spec/unit/helpers/settings_spec.rb
yousty-activeadmin-1.0.10.pre spec/unit/helpers/settings_spec.rb
yousty-activeadmin-1.0.9.pre spec/unit/helpers/settings_spec.rb
yousty-activeadmin-1.0.8.pre spec/unit/helpers/settings_spec.rb
activeadmin-1.0.0.pre4 spec/unit/helpers/settings_spec.rb
activeadmin-1.0.0.pre3 spec/unit/helpers/settings_spec.rb