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