Sha256: 4872731d442891beeaced9cd762489b3cbfa9df1cdfc1b500d65e55501f64573

Contents?: true

Size: 635 Bytes

Versions: 16

Compression:

Stored size: 635 Bytes

Contents

require 'spec_helper'

describe Spree::Preferences::Configuration, :type => :model do

  before :all do
    class AppConfig < Spree::Preferences::Configuration
      preference :color, :string, :default => :blue
    end
    @config = AppConfig.new
  end

  it "has named methods to access preferences" do
    @config.color = 'orange'
    expect(@config.color).to eq 'orange'
  end

  it "uses [ ] to access preferences" do
    @config[:color] = 'red'
    expect(@config[:color]).to eq 'red'
  end

  it "uses set/get to access preferences" do
    @config.set(color: 'green')
    expect(@config.get(:color)).to eq 'green'
  end

end



Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
solidus_core-1.2.3 spec/models/spree/preferences/configuration_spec.rb
solidus_core-1.1.4 spec/models/spree/preferences/configuration_spec.rb
solidus_core-1.0.7 spec/models/spree/preferences/configuration_spec.rb
solidus_core-1.0.6 spec/models/spree/preferences/configuration_spec.rb
solidus_core-1.2.2 spec/models/spree/preferences/configuration_spec.rb
solidus_core-1.2.1 spec/models/spree/preferences/configuration_spec.rb
solidus_core-1.1.3 spec/models/spree/preferences/configuration_spec.rb
solidus_core-1.0.5 spec/models/spree/preferences/configuration_spec.rb
solidus_core-1.2.0 spec/models/spree/preferences/configuration_spec.rb
solidus_core-1.2.0.rc2 spec/models/spree/preferences/configuration_spec.rb
solidus_core-1.0.4 spec/models/spree/preferences/configuration_spec.rb
solidus_core-1.1.2 spec/models/spree/preferences/configuration_spec.rb
solidus_core-1.2.0.rc1 spec/models/spree/preferences/configuration_spec.rb
solidus_core-1.2.0.beta1 spec/models/spree/preferences/configuration_spec.rb
solidus_core-1.0.3 spec/models/spree/preferences/configuration_spec.rb
solidus_core-1.1.1 spec/models/spree/preferences/configuration_spec.rb